├── .gitattributes ├── .gitignore ├── .gitmodules ├── CITATION.cff ├── LICENSE.txt ├── README.md ├── examples ├── assets │ ├── models │ │ ├── .gitignore │ │ └── cloth │ │ │ ├── README.txt │ │ │ ├── cloth.mtl │ │ │ └── cloth.obj │ └── scenes │ │ ├── SunTemple_v1-path.scn │ │ └── SunTemple_v1.scn ├── deferredRenderer │ ├── build │ │ ├── caches │ │ │ ├── D3D11 │ │ │ │ └── .gitignore │ │ │ └── OpenGL │ │ │ │ └── .gitignore │ │ ├── compiledShaders │ │ │ ├── D3D11 │ │ │ │ └── .gitignore │ │ │ └── OpenGL │ │ │ │ └── .gitignore │ │ └── output │ │ │ ├── D3D11 │ │ │ └── .gitignore │ │ │ └── OpenGL │ │ │ └── .gitignore │ ├── compile.t │ ├── compileRuntime.t │ ├── compileShaders.t │ ├── constants.t │ ├── gameRuntime │ │ ├── common.t │ │ └── main.t │ ├── shaders │ │ ├── DeferredShader.t │ │ ├── LightSystem.t │ │ ├── MaterialSystem.t │ │ ├── ShadingDataProvider.t │ │ ├── handwritten-fullyGeneral.hlsl │ │ ├── lightCulling.t │ │ ├── materialShader.t │ │ ├── quadShader.t │ │ └── shadows.t │ └── variantGeneration │ │ ├── implCompileShaders.t │ │ ├── implGenerateAllCaches.t │ │ └── implGenerateShaderCache.t └── shared │ ├── array.t │ ├── assimp.t │ ├── camera.t │ ├── d3d11.t │ ├── ddsLoader.t │ ├── gfx-d3d11.t │ ├── gfx-opengl.t │ ├── imgui.t │ ├── io-utilities.t │ ├── licenseInfoGUI.t │ ├── map.t │ ├── opengl.t │ ├── path.t │ ├── quat.t │ ├── scene-loader.t │ ├── sdl.t │ └── shaderCache-loader.t ├── external ├── .gitignore ├── KHR │ └── khrplatform.h ├── assimp │ ├── CHANGES │ ├── CREDITS │ ├── INSTALL │ ├── LICENSE │ ├── README │ ├── Readme.md │ └── include │ │ └── assimp │ │ ├── .editorconfig │ │ ├── Compiler │ │ ├── poppack1.h │ │ ├── pstdint.h │ │ └── pushpack1.h │ │ ├── DefaultIOStream.h │ │ ├── DefaultIOSystem.h │ │ ├── DefaultLogger.hpp │ │ ├── Defines.h │ │ ├── Exporter.hpp │ │ ├── IOStream.hpp │ │ ├── IOSystem.hpp │ │ ├── Importer.hpp │ │ ├── LogStream.hpp │ │ ├── Logger.hpp │ │ ├── NullLogger.hpp │ │ ├── ProgressHandler.hpp │ │ ├── SceneCombiner.h │ │ ├── ai_assert.h │ │ ├── anim.h │ │ ├── camera.h │ │ ├── cexport.h │ │ ├── cfileio.h │ │ ├── cimport.h │ │ ├── color4.h │ │ ├── color4.inl │ │ ├── config.h │ │ ├── config.h.in │ │ ├── defs.h │ │ ├── importerdesc.h │ │ ├── light.h │ │ ├── material.h │ │ ├── material.inl │ │ ├── matrix3x3.h │ │ ├── matrix3x3.inl │ │ ├── matrix4x4.h │ │ ├── matrix4x4.inl │ │ ├── mesh.h │ │ ├── metadata.h │ │ ├── port │ │ └── AndroidJNI │ │ │ └── AndroidJNIIOSystem.h │ │ ├── postprocess.h │ │ ├── quaternion.h │ │ ├── quaternion.inl │ │ ├── scene.h │ │ ├── texture.h │ │ ├── types.h │ │ ├── vector2.h │ │ ├── vector2.inl │ │ ├── vector3.h │ │ ├── vector3.inl │ │ └── version.h ├── built │ ├── .gitignore │ ├── bin │ │ └── x64 │ │ │ ├── assimp-vc120-mt.dll │ │ │ ├── cimgui.dll │ │ │ └── stbi.dll │ ├── lib │ │ └── x64 │ │ │ ├── assimp-vc120-mt.lib │ │ │ ├── cimgui.lib │ │ │ └── stbi.lib │ └── stb_image.c ├── cimgui │ ├── .gitignore │ ├── .gitmodules │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── Screen Shot 2015-04-09.png │ ├── cimgui │ │ ├── Makefile │ │ ├── cimgui.cpp │ │ ├── cimgui.h │ │ ├── cimgui.sln │ │ ├── cimgui.vcxproj │ │ ├── cimgui.vcxproj.filters │ │ ├── drawList.cpp │ │ ├── fontAtlas.cpp │ │ └── test.c │ ├── imgui │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── examples │ │ │ ├── .gitignore │ │ │ ├── README.txt │ │ │ ├── allegro5_example │ │ │ │ ├── README.md │ │ │ │ ├── imgui_impl_a5.cpp │ │ │ │ ├── imgui_impl_a5.h │ │ │ │ └── main.cpp │ │ │ ├── directx11_example │ │ │ │ ├── build_win32.bat │ │ │ │ ├── directx11_example.vcxproj │ │ │ │ ├── directx11_example.vcxproj.filters │ │ │ │ ├── imgui_impl_dx11.cpp │ │ │ │ ├── imgui_impl_dx11.h │ │ │ │ └── main.cpp │ │ │ ├── directx9_example │ │ │ │ ├── build_win32.bat │ │ │ │ ├── directx9_example.vcxproj │ │ │ │ ├── directx9_example.vcxproj.filters │ │ │ │ ├── imgui_impl_dx9.cpp │ │ │ │ ├── imgui_impl_dx9.h │ │ │ │ └── main.cpp │ │ │ ├── imgui_examples_msvc2010.sln │ │ │ ├── ios_example │ │ │ │ ├── .gitignore │ │ │ │ ├── README.md │ │ │ │ ├── imguiex.xcodeproj │ │ │ │ │ └── project.pbxproj │ │ │ │ └── imguiex │ │ │ │ │ ├── AppDelegate.h │ │ │ │ │ ├── AppDelegate.m │ │ │ │ │ ├── Base.lproj │ │ │ │ │ ├── LaunchScreen.xib │ │ │ │ │ └── Main.storyboard │ │ │ │ │ ├── GameViewController.h │ │ │ │ │ ├── GameViewController.m │ │ │ │ │ ├── Images.xcassets │ │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ │ ├── Contents.json │ │ │ │ │ │ ├── icon_imgui_60@2x~iphone.png │ │ │ │ │ │ ├── icon_imgui_60@3x~iphone.png │ │ │ │ │ │ ├── icon_imgui_76@2x~ipad.png │ │ │ │ │ │ └── icon_imgui_76~ipad.png │ │ │ │ │ ├── Info.plist │ │ │ │ │ ├── Shaders │ │ │ │ │ ├── Shader.fsh │ │ │ │ │ └── Shader.vsh │ │ │ │ │ ├── debug_hud.cpp │ │ │ │ │ ├── debug_hud.h │ │ │ │ │ ├── imgui_ex_icon.png │ │ │ │ │ ├── imgui_impl_ios.h │ │ │ │ │ ├── imgui_impl_ios.mm │ │ │ │ │ └── main.m │ │ │ ├── libs │ │ │ │ ├── gl3w │ │ │ │ │ └── GL │ │ │ │ │ │ ├── gl3w.c │ │ │ │ │ │ └── gl3w.h │ │ │ │ ├── glfw │ │ │ │ │ ├── COPYING.txt │ │ │ │ │ └── include │ │ │ │ │ │ └── GLFW │ │ │ │ │ │ ├── glfw3.h │ │ │ │ │ │ └── glfw3native.h │ │ │ │ └── usynergy │ │ │ │ │ ├── uSynergy.c │ │ │ │ │ └── uSynergy.h │ │ │ ├── marmalade_example │ │ │ │ ├── data │ │ │ │ │ └── app.icf │ │ │ │ ├── imgui_impl_marmalade.cpp │ │ │ │ ├── imgui_impl_marmalade.h │ │ │ │ ├── main.cpp │ │ │ │ └── marmalade_example.mkb │ │ │ ├── opengl3_example │ │ │ │ ├── Makefile │ │ │ │ ├── build_win32.bat │ │ │ │ ├── imgui_impl_glfw_gl3.cpp │ │ │ │ ├── imgui_impl_glfw_gl3.h │ │ │ │ ├── main.cpp │ │ │ │ ├── opengl3_example.vcxproj │ │ │ │ └── opengl3_example.vcxproj.filters │ │ │ ├── opengl_example │ │ │ │ ├── Makefile │ │ │ │ ├── build_win32.bat │ │ │ │ ├── imgui_impl_glfw.cpp │ │ │ │ ├── imgui_impl_glfw.h │ │ │ │ ├── main.cpp │ │ │ │ ├── opengl_example.vcxproj │ │ │ │ └── opengl_example.vcxproj.filters │ │ │ └── sdl_opengl_example │ │ │ │ ├── README.md │ │ │ │ ├── imgui_impl_sdl.cpp │ │ │ │ ├── imgui_impl_sdl.h │ │ │ │ └── main.cpp │ │ ├── extra_fonts │ │ │ ├── Cousine-Regular.ttf │ │ │ ├── DroidSans.ttf │ │ │ ├── Karla-Regular.ttf │ │ │ ├── ProggyClean.ttf │ │ │ ├── ProggyTiny.ttf │ │ │ ├── README.txt │ │ │ └── binary_to_compressed_c.cpp │ │ ├── imconfig.h │ │ ├── imgui.cpp │ │ ├── imgui.h │ │ ├── imgui_demo.cpp │ │ ├── imgui_draw.cpp │ │ ├── imgui_internal.h │ │ ├── stb_rect_pack.h │ │ ├── stb_textedit.h │ │ └── stb_truetype.h │ └── menus-api.gif ├── glcorearb.h └── glext.h └── src ├── builtin.t ├── extensionBuilder.t ├── gfx-utils.t ├── gfx.t ├── pipelineBuilder.t ├── pipelineWrapper.t ├── pipelineWrapperSyntax.t ├── pipelinelang.t ├── selos.t ├── terraToGLSL.t ├── terraToHLSL.t ├── terraToShader.t └── utilities.t /.gitattributes: -------------------------------------------------------------------------------- 1 | *.t linguist-language=Lua 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.lib 3 | *.exp 4 | 5 | *.ini 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "external/stb"] 2 | path = external/stb 3 | url = https://github.com/nothings/stb.git 4 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | message: "If you use this software, please cite the associated technical paper from the preferred-citation." 3 | title: "Staged Metaprogramming for Shader System Development" 4 | authors: 5 | - given-names: "Kerry A." 6 | family-names: "Seitz" 7 | name-suffix: "Jr." 8 | email: "kaseitz@ucdavis.edu" 9 | affiliation: "University of California, Davis" 10 | orcid: "https://orcid.org/0000-0003-2424-9495" 11 | - given-names: "T." 12 | family-names: "Foley" 13 | email: "tfoley@nvidia.com" 14 | affiliation: "NVIDIA" 15 | orcid: "https://orcid.org/0000-0002-2381-3544" 16 | - given-names: "Serban D." 17 | family-names: "Porumbescu" 18 | email: "sdporumbescu@ucdavis.edu" 19 | affiliation: "University of California, Davis" 20 | orcid: "https://orcid.org/0000-0003-1523-9199" 21 | - given-names: "John D." 22 | family-names: "Owens" 23 | email: "jowens@ece.ucdavis.edu" 24 | affiliation: "University of California, Davis" 25 | orcid: "https://orcid.org/0000-0001-6582-8237" 26 | repository-code: "https://github.com/kseitz/selos" 27 | preferred-citation: 28 | type: article 29 | title: "Staged Metaprogramming for Shader System Development" 30 | authors: 31 | - given-names: "Kerry A." 32 | family-names: "Seitz" 33 | name-suffix: "Jr." 34 | email: "kaseitz@ucdavis.edu" 35 | affiliation: "University of California, Davis" 36 | orcid: "https://orcid.org/0000-0003-2424-9495" 37 | - given-names: "T." 38 | family-names: "Foley" 39 | email: "tfoley@nvidia.com" 40 | affiliation: "NVIDIA" 41 | orcid: "https://orcid.org/0000-0002-2381-3544" 42 | - given-names: "Serban D." 43 | family-names: "Porumbescu" 44 | email: "sdporumbescu@ucdavis.edu" 45 | affiliation: "University of California, Davis" 46 | orcid: "https://orcid.org/0000-0003-1523-9199" 47 | - given-names: "John D." 48 | family-names: "Owens" 49 | email: "jowens@ece.ucdavis.edu" 50 | affiliation: "University of California, Davis" 51 | orcid: "https://orcid.org/0000-0001-6582-8237" 52 | journal: "ACM Transactions on Graphics" 53 | year: 2019 54 | volume: 38 55 | issue: 6 56 | start: "202:1" 57 | end: "202:15" 58 | month: 11 59 | doi: 10.1145/3355089.3356554 60 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Excluding the "external" directory, this code is licensed under 2 | the 3-clause BSD license as follows: 3 | 4 | Copyright (c) 2019, The Regents of the University of California, 5 | Davis campus. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions 9 | are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of The Regents of the University of California, 16 | Davis campus nor the names of its contributors may be used to endorse 17 | or promote products derived from this software without specific prior 18 | written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 21 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 28 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | 33 | In addition to the above, some files are also licensed under 34 | the 3-clause BSD license as follows: 35 | 36 | Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. 37 | 38 | Redistribution and use in source and binary forms, with or without 39 | modification, are permitted provided that the following conditions 40 | are met: 41 | * Redistributions of source code must retain the above copyright 42 | notice, this list of conditions and the following disclaimer. 43 | * Redistributions in binary form must reproduce the above copyright 44 | notice, this list of conditions and the following disclaimer in the 45 | documentation and/or other materials provided with the distribution. 46 | * Neither the name of NVIDIA CORPORATION nor the names of its 47 | contributors may be used to endorse or promote products derived 48 | from this software without specific prior written permission. 49 | 50 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 51 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 52 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 53 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 54 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 55 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 56 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 57 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 58 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 59 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 60 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 61 | 62 | 63 | For code contained in the "external" directory and its subdirectories, 64 | please refer to the specific copyright and licensing information 65 | contained therein. 66 | -------------------------------------------------------------------------------- /examples/assets/models/.gitignore: -------------------------------------------------------------------------------- 1 | SunTemple_v1 2 | -------------------------------------------------------------------------------- /examples/assets/models/cloth/README.txt: -------------------------------------------------------------------------------- 1 | Based on https://github.com/google/filament/tree/master/assets/models/cloth 2 | 3 | Modified to remove the base on which the cloth is draped, leaving just the cloth itself. 4 | -------------------------------------------------------------------------------- /examples/assets/models/cloth/cloth.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'cloth.blend' 2 | # Material Count: 2 3 | 4 | newmtl cloth 5 | Ns 96.078431 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.300000 0.000000 0.000000 8 | Ks 0.000000 0.000000 0.000000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.000000 11 | d 1.000000 12 | illum 2 13 | 14 | newmtl outside 15 | Ns 94.117647 16 | Ka 0.000000 0.000000 0.000000 17 | Kd 0.511863 0.621656 0.640000 18 | Ks 0.500000 0.500000 0.500000 19 | Ke 0.000000 0.000000 0.000000 20 | Ni 1.000000 21 | d 1.000000 22 | illum 2 23 | -------------------------------------------------------------------------------- /examples/assets/scenes/SunTemple_v1.scn: -------------------------------------------------------------------------------- 1 | camera { 2 | sensitivity = 1 3 | position = 0.01715730130672455 3.184415578842163 71.125 4 | target = 0.008677838370203972 3.20275616645813 70.12520599365235 5 | up = 0.002032371936365962 0.999836266040802 0.01836729794740677 6 | } 7 | 8 | object { 9 | name = SunTemple 10 | filename = ../../assets/models/SunTemple_v1/SunTemple.fbx 11 | transforms { 12 | scale 1.0 1.0 1.0 13 | } 14 | materialModelOverrides { 15 | M_FirePit_Inst = StandardMaterialWithClearCoat 16 | M_FirePit_Inst_Glow = StandardMaterialWithClearCoat 17 | M_FirePit_Inst_nofire = StandardMaterialWithClearCoat 18 | M_Statue_Inst = SubsurfaceMaterial 19 | } 20 | } 21 | 22 | object { 23 | name = Cloth0 24 | filename = ../../assets/models/cloth/cloth.obj 25 | materialModel = ClothMaterial 26 | transforms { 27 | translate -2.8546500205993654 3.468505859375 66.39163970947266 28 | scale 0.2 0.2 0.2 29 | rotate 50 0 1 0 30 | } 31 | } 32 | 33 | object { 34 | name = Cloth1 35 | filename = ../../assets/models/cloth/cloth.obj 36 | materialModel = ClothMaterial 37 | transforms { 38 | translate 3.0635008811950685 3.468505859375 66.34196472167969 39 | scale 0.2 0.2 0.2 40 | rotate -50 0 1 0 41 | } 42 | } 43 | 44 | object { 45 | name = Cloth2 46 | filename = ../../assets/models/cloth/cloth.obj 47 | materialModel = ClothMaterial 48 | transforms { 49 | translate 3.0635008811950685 3.468505859375 49.689964294433597 50 | scale 0.2 0.2 0.2 51 | rotate -50 0 1 0 52 | } 53 | } 54 | 55 | object { 56 | name = Cloth3 57 | filename = ../../assets/models/cloth/cloth.obj 58 | materialModel = ClothMaterial 59 | transforms { 60 | translate -2.8546500205993654 3.468505859375 49.75494384765625 61 | scale 0.2 0.2 0.2 62 | rotate 50 0 1 0 63 | } 64 | } 65 | 66 | object { 67 | name = Cloth4 68 | filename = ../../assets/models/cloth/cloth.obj 69 | materialModel = ClothMaterial 70 | transforms { 71 | translate -0.06653916835784912 6.099518775939941 30.068578720092775 72 | scale 0.3 0.3 0.3 73 | rotate -40 0 1 0 74 | } 75 | } 76 | 77 | object { 78 | name = Cloth5 79 | filename = ../../assets/models/cloth/cloth.obj 80 | materialModel = ClothMaterial 81 | transforms { 82 | translate 0.10814739763736725 10.428841590881348 -0.06849503517150879 83 | scale 0.4 0.4 0.4 84 | rotate 40 0 1 0 85 | } 86 | } 87 | 88 | 89 | -- LIGHTS 90 | 91 | dirLight { 92 | name = dirLight0 93 | intensity = 1 1 1 94 | direction = 0.8601616621017456 -0.11900000274181366 0.49594444036483767 95 | } 96 | 97 | pointLight { 98 | name = PointLight0 99 | intensity = 1.0 0.6000000238418579 0.3137255012989044 100 | position = 1.6393406391143799 2.450000047683716 70.8550033569336 101 | } 102 | 103 | pointLight { 104 | name = PointLight1 105 | intensity = 1.0 0.6000000238418579 0.3137255012989044 106 | position = -1.4549025297164918 2.450000047683716 70.8550033569336 107 | } 108 | 109 | shadowedPointLight { 110 | name = PointLight2 111 | intensity = 1.0 0.6000000238418579 0.3137255012989044 112 | position = -2.093762159347534 2.450000047683716 50.80758285522461 113 | } 114 | 115 | pointLight { 116 | name = PointLight3 117 | intensity = 0.25 0.020588235929608346 0.0 118 | position = 0.0 1.723734974861145 58.020023345947269 119 | } 120 | 121 | pointLight { 122 | name = PointLight4 123 | intensity = 1.0 0.6000000238418579 0.3137255012989044 124 | position = -7.148975372314453 2.450000047683716 43.18354034423828 125 | } 126 | 127 | pointLight { 128 | name = PointLight5 129 | intensity = 1.0 0.6000000238418579 0.3137255012989044 130 | position = 7.211925506591797 2.450000047683716 43.288002014160159 131 | } 132 | 133 | shadowedPointLight { 134 | name = PointLight6 135 | intensity = 1.0 0.6039215922355652 0.3137255012989044 136 | position = 2.4240572452545168 2.450000047683716 28.55856704711914 137 | } 138 | 139 | pointLight { 140 | name = PointLight7 141 | intensity = 1.0 0.6000000238418579 0.3137255012989044 142 | position = 7.45982027053833 4.4150004386901859 18.061458587646486 143 | } 144 | 145 | pointLight { 146 | name = PointLight8 147 | intensity = 1.0 0.6039215922355652 0.3137255012989044 148 | position = 7.909985065460205 4.414999961853027 -2.1510772705078127 149 | } 150 | 151 | pointLight { 152 | name = PointLight9 153 | intensity = 1.0 0.6039215922355652 0.3137255012989044 154 | position = 2.1134257316589357 4.414999961853027 -7.972902297973633 155 | } 156 | 157 | pointLight { 158 | name = PointLight10 159 | intensity = 1.0 0.6039215922355652 0.3137255012989044 160 | position = -7.98183012008667 4.414999961853027 -2.0562009811401369 161 | } 162 | 163 | pointLight { 164 | name = PointLight11 165 | intensity = 1.0 0.6039215922355652 0.3137255012989044 166 | position = -3.0991241931915285 4.414999961853027 7.863924026489258 167 | } 168 | 169 | pointLight { 170 | name = PointLight12 171 | intensity = 0.250980406999588 0.021568628028035165 0.0 172 | position = -0.028223201632499696 1.624000072479248 31.539669036865236 173 | } 174 | -------------------------------------------------------------------------------- /examples/deferredRenderer/build/caches/D3D11/.gitignore: -------------------------------------------------------------------------------- 1 | *.dat -------------------------------------------------------------------------------- /examples/deferredRenderer/build/caches/OpenGL/.gitignore: -------------------------------------------------------------------------------- 1 | *.dat -------------------------------------------------------------------------------- /examples/deferredRenderer/build/compiledShaders/D3D11/.gitignore: -------------------------------------------------------------------------------- 1 | *.vert 2 | *.frag 3 | *.comp 4 | -------------------------------------------------------------------------------- /examples/deferredRenderer/build/compiledShaders/OpenGL/.gitignore: -------------------------------------------------------------------------------- 1 | *.vert 2 | *.frag 3 | *.comp 4 | -------------------------------------------------------------------------------- /examples/deferredRenderer/build/output/D3D11/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /examples/deferredRenderer/build/output/OpenGL/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /examples/deferredRenderer/compile.t: -------------------------------------------------------------------------------- 1 | require "compileShaders" 2 | require "compileRuntime" 3 | -------------------------------------------------------------------------------- /examples/deferredRenderer/compileRuntime.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | package.terrapath = package.terrapath .. "?.t;"; 31 | package.terrapath = package.terrapath .. "gameRuntime/?.t;"; 32 | package.terrapath = package.terrapath .. "shaders/?.t;"; 33 | 34 | package.terrapath = package.terrapath .. "../../src/?.t;"; 35 | package.terrapath = package.terrapath .. "../shared/?.t;"; 36 | 37 | gCurrentGraphicsAPIName = "gfx-opengl"; 38 | 39 | local ffi = require "ffi" 40 | local os = ffi.os 41 | 42 | if ffi.arch ~= "x64" then 43 | error("Selos only supports 64-bit architectures.") 44 | end 45 | 46 | -- parse the args provided at compile time, and filter to produce a runtime arg list 47 | local function parseCompileTimeArgs(args) 48 | local runtimeArgs = {} 49 | runtimeArgs[-1] = arg[-1] 50 | runtimeArgs[0] = arg[0] 51 | 52 | local i = 1; 53 | local argCount = #arg; 54 | local rtArgCount = 0; 55 | while i <= argCount do 56 | local arg = args[i]; 57 | if arg == "--d3d11" then 58 | if os ~= "Windows" then 59 | error("D3D11 is only supported on Windows") 60 | end 61 | gCurrentGraphicsAPIName = "gfx-d3d11"; 62 | elseif arg == "--opengl" then 63 | gCurrentGraphicsAPIName = "gfx-opengl"; 64 | else 65 | rtArgCount = rtArgCount + 1; 66 | runtimeArgs[rtArgCount] = arg; 67 | end 68 | i = i + 1; 69 | end 70 | 71 | return runtimeArgs; 72 | end 73 | 74 | local arg = parseCompileTimeArgs(arg); 75 | 76 | externalPath = "../../external/" 77 | externalLibPath = externalPath .. "built/lib/x64/" 78 | SDLPath = externalPath .. "SDL2/" 79 | SDLLibPath = SDLPath .. "lib/x64/" 80 | 81 | require "main" 82 | 83 | if os == "Windows" then 84 | if gCurrentGraphicsAPIName == "gfx-d3d11" then 85 | terralib.saveobj("build/runGame-D3D11.exe", {main = main}, 86 | { 87 | "d3d11.lib", "d3dcompiler.lib", 88 | "User32.lib", 89 | SDLLibPath .. "SDL2.lib", 90 | externalLibPath .. "stbi.lib", 91 | externalLibPath .. "cimgui.lib", 92 | externalLibPath .. "assimp-vc120-mt.lib", 93 | }) 94 | else 95 | terralib.saveobj("build/runGame-OpenGL.exe", {main = main}, 96 | { 97 | "opengl32.lib", "glu32.lib", 98 | SDLLibPath .. "SDL2.lib", 99 | externalLibPath .. "stbi.lib", 100 | externalLibPath .. "cimgui.lib", 101 | externalLibPath .. "assimp-vc120-mt.lib", 102 | }) 103 | end 104 | else 105 | error("Selos only supports Windows and Linux. Current OS is " .. os) 106 | end 107 | 108 | -------------------------------------------------------------------------------- /examples/deferredRenderer/compileShaders.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | package.terrapath = package.terrapath .. "?.t;"; 31 | package.terrapath = package.terrapath .. "variantGeneration/?.t;"; 32 | package.terrapath = package.terrapath .. "shaders/?.t;"; 33 | 34 | package.terrapath = package.terrapath .. "../../src/?.t;"; 35 | package.terrapath = package.terrapath .. "../shared/?.t;"; 36 | 37 | gCurrentGraphicsAPIName = "gfx-opengl"; 38 | 39 | local ffi = require "ffi" 40 | local os = ffi.os 41 | 42 | if ffi.arch ~= "x64" then 43 | error("Selos only supports 64-bit architectures.") 44 | end 45 | 46 | -- parse the args provided at compile time, and filter to produce a runtime arg list 47 | local function parseCompileTimeArgs(args) 48 | local runtimeArgs = {} 49 | runtimeArgs[-1] = arg[-1] 50 | runtimeArgs[0] = arg[0] 51 | 52 | local i = 1; 53 | local argCount = #arg; 54 | local rtArgCount = 0; 55 | while i <= argCount do 56 | local arg = args[i]; 57 | if arg == "--d3d11" then 58 | if os ~= "Windows" then 59 | error("D3D11 is only supported on Windows") 60 | end 61 | gCurrentGraphicsAPIName = "gfx-d3d11"; 62 | elseif arg == "--opengl" then 63 | gCurrentGraphicsAPIName = "gfx-opengl"; 64 | else 65 | rtArgCount = rtArgCount + 1; 66 | runtimeArgs[rtArgCount] = arg; 67 | end 68 | i = i + 1; 69 | end 70 | 71 | return runtimeArgs; 72 | end 73 | 74 | local arg = parseCompileTimeArgs(arg); 75 | 76 | externalPath = "../../external/" 77 | SDLPath = externalPath .. "SDL2/" 78 | 79 | print("Generating Shader Caches...") 80 | 81 | local outputCache = require("implGenerateShaderCache") 82 | local MaterialShader = require "materialShader" 83 | 84 | local config = MaterialShader.deferred:getDefaultConfiguration() 85 | local numComponents = (#config.MaterialType.statusList + #config.LightEnv.statusList) 86 | 87 | local cachePath = "build/caches/" 88 | if gCurrentGraphicsAPIName == "gfx-d3d11" then 89 | cachePath = cachePath .. "D3D11/" 90 | else 91 | cachePath = cachePath .. "OpenGL/" 92 | end 93 | 94 | local files = { 95 | {allowSpec = false, path = cachePath .. "shaderCache-fullyGeneral.dat"}, 96 | {allowSpec = true, path = cachePath .. "shaderCache-fullySpecialized.dat"}, 97 | } 98 | 99 | for i,v in ipairs(files) do 100 | local allowSpecList = terralib.newlist() 101 | for i=1, numComponents do 102 | allowSpecList:insert(v.allowSpec) 103 | end 104 | local file = io.open(v.path, "w") 105 | io.output(file) 106 | outputCache(allowSpecList) 107 | io.close(file) 108 | end 109 | 110 | require "implGenerateAllCaches" 111 | 112 | print("Finished\n") 113 | 114 | require "implCompileShaders" 115 | -------------------------------------------------------------------------------- /examples/deferredRenderer/constants.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | -- TODO We are currently not automating specialization of the forward shader, 31 | -- so these values are hardcoded for now. Fix this. 32 | local FWD_BIT_FLAGS = {} 33 | FWD_BIT_FLAGS.DIFFUSE_MAP = 1 34 | FWD_BIT_FLAGS.SPECULAR_MAP = 2 35 | FWD_BIT_FLAGS.EMISSIVE_MAP = 4 36 | FWD_BIT_FLAGS.NORMAL_MAP = 8 37 | 38 | -- For benchmarking, we want the exact same frames each time, so we assume a constant FPS 39 | local BENCHMARK_FPS = terralib.constant(int, 60) -- Lock to a constant FPS 40 | local BENCHMARK_FRAMETIME = terralib.constant(float, (`(1.0f) / BENCHMARK_FPS)) 41 | local BENCHMARK_MEASURE_EVERY_X_FRAMES = terralib.constant(int, 100) -- Perform benchmarking every X frames 42 | local BENCHMARK_NUM_TIMES_TO_LOOP = terralib.constant(int, 1000) -- Number of times to repeat the operation before stopping timer 43 | -- (to ensure enough time has elapsed between starting/stopping the timer) 44 | local BENCHMARK_RENDER_ALL_FRAMES = terralib.constant(false) 45 | local BENCHMARK_NUM_LIGHT_ITERS = terralib.constant(1) 46 | 47 | local TILE_SIZE = 16 48 | local MAX_TEX_COORDS = 8 49 | local NUM_CASCADES = 3 50 | local LIGHT_CULLING_NUM_THREADS = 16 51 | 52 | local MAX_DIR_LIGHTS = 1 53 | local MAX_POINT_LIGHTS = 11 54 | local MAX_SHADOWED_POINT_LIGHTS = 2 55 | 56 | local POINT_LIGHT_FARZ = constant(float, 50.0) 57 | 58 | -- TODO Using hardcoded radius for now. Fix this. 59 | -- The value of 25 seems reasonable for the Sun Temple scene. 60 | local POINT_LIGHT_RADIUS = `25.0f 61 | 62 | local MAX_WINDOW_WIDTH = 1920 63 | local MAX_WINDOW_HEIGHT = 1080 64 | 65 | local function calcMaxNumTiles() 66 | local numTilesX = math.ceil((MAX_WINDOW_WIDTH / TILE_SIZE)) 67 | local numTilesY = math.ceil((MAX_WINDOW_HEIGHT / TILE_SIZE)) 68 | 69 | return numTilesX * numTilesY 70 | end 71 | 72 | local MAX_NUM_TILES = calcMaxNumTiles() 73 | 74 | return { 75 | BENCHMARK_FPS = BENCHMARK_FPS, 76 | BENCHMARK_FRAMETIME = BENCHMARK_FRAMETIME, 77 | BENCHMARK_MEASURE_EVERY_X_FRAMES = BENCHMARK_MEASURE_EVERY_X_FRAMES, 78 | BENCHMARK_NUM_TIMES_TO_LOOP = BENCHMARK_NUM_TIMES_TO_LOOP, 79 | BENCHMARK_RENDER_ALL_FRAMES = BENCHMARK_RENDER_ALL_FRAMES, 80 | BENCHMARK_NUM_LIGHT_ITERS = BENCHMARK_NUM_LIGHT_ITERS, 81 | FWD_BIT_FLAGS = FWD_BIT_FLAGS, 82 | TILE_SIZE = TILE_SIZE, 83 | MAX_NUM_TILES = MAX_NUM_TILES, 84 | NUM_CASCADES = NUM_CASCADES, 85 | LIGHT_CULLING_NUM_THREADS = LIGHT_CULLING_NUM_THREADS, 86 | MAX_DIR_LIGHTS = MAX_DIR_LIGHTS, 87 | MAX_POINT_LIGHTS = MAX_POINT_LIGHTS, 88 | MAX_SHADOWED_POINT_LIGHTS = MAX_SHADOWED_POINT_LIGHTS, 89 | POINT_LIGHT_FARZ = POINT_LIGHT_FARZ, 90 | POINT_LIGHT_RADIUS = POINT_LIGHT_RADIUS, 91 | MAX_TEX_COORDS = MAX_TEX_COORDS, 92 | DEFAULT_WINDOW_WIDTH = MAX_WINDOW_WIDTH, 93 | DEFAULT_WINDOW_HEIGHT = MAX_WINDOW_HEIGHT, 94 | ROUGH_METAL_MODEL = `false, 95 | } 96 | -------------------------------------------------------------------------------- /examples/deferredRenderer/shaders/DeferredShader.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | import "pipelineWrapperSyntax" 31 | 32 | local Gfx = require("gfx") 33 | local CONSTANTS = require("constants") 34 | local TILE_SIZE = CONSTANTS.TILE_SIZE 35 | 36 | local SDP = require("ShadingDataProvider") 37 | local MaterialSystem = require("MaterialSystem") 38 | local LightSystem = require("LightSystem") 39 | 40 | 41 | local pipeline DeferredMaterialShader { 42 | ConfigurationOptions { 43 | MaterialType = MaterialSystem.TiledDeferredMaterialType.new() 44 | LightEnv = LightSystem.TiledLightListEnv.new() 45 | } 46 | 47 | numthreads(TILE_SIZE, TILE_SIZE, 1) 48 | 49 | textureImage(Gfx.TextureFormat.RGBA32F, Gfx.MapMode.ReadOnly) gbuffers : image2D[5] 50 | textureImage(Gfx.TextureFormat.RGBA16U, Gfx.MapMode.ReadOnly) tileList : uimage2D 51 | textureImage(Gfx.TextureFormat.RGBA16F, Gfx.MapMode.WriteOnly) outImage : image2D 52 | 53 | uniform Camera { 54 | cameraPos : vec3 55 | numTilesX : int 56 | cameraVP : mat4 57 | } 58 | 59 | 60 | compute code 61 | var tileIDxyzw : uvec4 = imageLoad(tileList, make_ivec2(WorkGroupID.x / 4, [getConfigurationID()])) 62 | var tileID = tileIDxyzw(WorkGroupID.x % 4) 63 | 64 | var tileCoords = make_ivec2(tileID % numTilesX, tileID / numTilesX) 65 | 66 | var locID : ivec2 67 | locID.x = LocalInvocationID.x 68 | locID.y = LocalInvocationID.y 69 | 70 | var pixelCoords = (tileCoords * TILE_SIZE) + locID 71 | 72 | var sd : MaterialType:ShadingDataType() 73 | [SDP.GBufferShadingData.prepare(gbuffers, cameraPos, pixelCoords, sd)] 74 | 75 | if CONSTANTS.ROUGH_METAL_MODEL then 76 | -- R - Occlusion; G - Roughness; B - Metalness 77 | var spec = sd.specular 78 | var baseColor = sd.diffuse 79 | 80 | sd.diffuse = lerp(baseColor.rgb, make_vec3(0, 0, 0), spec.b); 81 | 82 | -- UE4 uses 0.08 multiplied by a default specular value of 0.5 as a base, hence the 0.04 83 | sd.specular = lerp(make_vec3(0.04f), baseColor.rgb, spec.b); 84 | sd.linearRoughness = spec.g; 85 | end 86 | 87 | sd.linearRoughness = max(0.08f, sd.linearRoughness) 88 | 89 | var clipZ : float = (cameraVP * make_vec4(sd.wPos, 1f)).z 90 | 91 | var colorAcc = [LightEnv:illuminate(MaterialType)](sd, clipZ, tileID) 92 | 93 | colorAcc = colorAcc + sd.emissive 94 | 95 | var color = make_vec4(colorAcc, 1) 96 | imageStore(outImage, pixelCoords, color) 97 | end 98 | } 99 | 100 | return DeferredMaterialShader 101 | -------------------------------------------------------------------------------- /examples/deferredRenderer/shaders/quadShader.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | import "pipelineWrapperSyntax" 31 | 32 | local gLuminanceLod = 16 33 | local gExposureKey = `(0.042f) 34 | 35 | local terra calcLuminance(color : vec3) 36 | return dot(color.xyz, make_vec3(0.299f, 0.587f, 0.114f)); 37 | end 38 | 39 | local terra linearToneMap(color : vec3) 40 | return color; -- Do nothing 41 | end 42 | 43 | 44 | local pipeline LuminanceShader { 45 | input inPosition : vec3 46 | input inTexCoord : vec2 47 | 48 | varying vTexCoord : vec2 49 | out outColor : vec4 50 | 51 | textureSampler tex : sampler2D 52 | 53 | vertex code 54 | Position = make_vec4(inPosition, 1) 55 | vTexCoord = inTexCoord 56 | end 57 | 58 | fragment code 59 | var color = texture(tex, make_vec2(vTexCoord.x, 1-vTexCoord.y)) 60 | 61 | var luminance = calcLuminance(color.xyz); 62 | luminance = 0.0060f -- hardcoding luminance to avoid flickering as camera moves 63 | luminance = log2(max(0.0001f, luminance)); 64 | outColor = make_vec4(luminance, 0, 0, 1); 65 | end 66 | } 67 | 68 | local pipeline QuadShader { 69 | input inPosition : vec3 70 | input inTexCoord : vec2 71 | 72 | varying vTexCoord : vec2 73 | out outColor : vec4 74 | 75 | textureSampler tex : sampler2D 76 | textureSampler lumTex : sampler2D 77 | 78 | 79 | local calcExposedColor = terra(color : vec3, texC : vec2) 80 | var pixelLuminance = calcLuminance(color); 81 | var avgLuminance : float = textureLod(lumTex, make_vec2(texC.x, 1-texC.y), gLuminanceLod).r; 82 | avgLuminance = exp2(avgLuminance); 83 | var exposedLuminance = (gExposureKey / avgLuminance); 84 | return exposedLuminance*color; 85 | end 86 | 87 | 88 | vertex code 89 | Position = make_vec4(inPosition, 1) 90 | vTexCoord = inTexCoord 91 | end 92 | 93 | fragment code 94 | var color = texture(tex, make_vec2(vTexCoord.x, 1-vTexCoord.y)) 95 | var exposedColor = calcExposedColor(color.rgb, vTexCoord); 96 | 97 | outColor = make_vec4(linearToneMap(exposedColor), color.a); 98 | end 99 | } 100 | 101 | return { 102 | QuadShader = QuadShader, 103 | LuminanceShader = LuminanceShader, 104 | } 105 | -------------------------------------------------------------------------------- /examples/deferredRenderer/shaders/shadows.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | import "pipelineWrapperSyntax" 31 | 32 | local MAX_TEX_COORDS = require("constants").MAX_TEX_COORDS 33 | 34 | local pipeline DirLightShadowShader { 35 | input inPosition : vec3 36 | input inNormal : vec3 37 | input inTexCoord : vec2[MAX_TEX_COORDS] 38 | 39 | uniform Uniforms 40 | { 41 | mvp : mat4 42 | } 43 | 44 | vertex code 45 | var pos = make_vec4(inPosition, 1) 46 | Position = mvp * pos 47 | end 48 | fragment code 49 | -- depth is written to the depth texture 50 | end 51 | } 52 | 53 | local pipeline PointLightShadowShader { 54 | input inPosition : vec3 55 | input inNormal : vec3 56 | input inTexCoord : vec2[MAX_TEX_COORDS] 57 | 58 | varying wPos : vec4 59 | 60 | uniform Uniforms 61 | { 62 | mvp : mat4 63 | m : mat4 64 | lightPos : vec3 65 | farPlane : float 66 | } 67 | 68 | vertex code 69 | var pos = make_vec4(inPosition, 1) 70 | wPos = m * pos 71 | Position = mvp * pos 72 | end 73 | fragment code 74 | var lightDistance = length(wPos.xyz - lightPos) 75 | lightDistance = lightDistance / farPlane 76 | FragDepth = lightDistance 77 | end 78 | } 79 | 80 | return { 81 | dirLightShadow = DirLightShadowShader, 82 | pointLightShadow = PointLightShadowShader, 83 | } -------------------------------------------------------------------------------- /examples/deferredRenderer/variantGeneration/implGenerateAllCaches.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | local MaterialShader = require "materialShader" 31 | 32 | local bit = require("bit") 33 | local Utils = require("utilities") 34 | 35 | local outputCache = require("implGenerateShaderCache") 36 | 37 | local cacheDir = "build/caches/" 38 | if gCurrentGraphicsAPIName == "gfx-d3d11" then 39 | cacheDir = cacheDir .. "D3D11/" 40 | else 41 | cacheDir = cacheDir .. "OpenGL/" 42 | end 43 | 44 | local w = io.write 45 | local function w(ln) 46 | io.write(ln) 47 | io.write("\n") 48 | end 49 | 50 | local NUM_MATERIAL_TYPES = #(MaterialShader.deferred:getDefaultConfiguration().MaterialType.statusList) 51 | local NUM_LIGHT_TYPES = #(MaterialShader.deferred:getDefaultConfiguration().LightEnv.statusList) 52 | local NUM_COMPONENTS = NUM_MATERIAL_TYPES + NUM_LIGHT_TYPES 53 | 54 | local function combinations(elems, start, n, k, maxk, specLists) 55 | if k > maxk then 56 | local list = terralib.newlist() 57 | for i=1, n do 58 | list[i] = false 59 | end 60 | for i=1, maxk do 61 | list[elems[i]] = true 62 | end 63 | specLists:insert(list) 64 | else 65 | for i=start, n do 66 | elems[k] = i 67 | combinations(elems, i+1, n, k+1, maxk, specLists) 68 | end 69 | end 70 | end 71 | 72 | local function createCaches(n) 73 | local specLists = terralib.newlist() 74 | combinations({}, 1, NUM_COMPONENTS, 1, n, specLists) 75 | 76 | local specSetOutput = terralib.newlist() 77 | for i=1, #specLists do 78 | local spec = specLists[i] 79 | 80 | local specString = "" 81 | for j=1, #spec do 82 | specString = specString .. Utils.boolToInt(spec[j]) 83 | end 84 | local outpath = cacheDir .. specString .. ".dat" 85 | 86 | local file = io.open(outpath, "w") 87 | io.output(file) 88 | outputCache(spec) 89 | io.close(file) 90 | 91 | specSetOutput:insert("../" .. outpath) 92 | specSetOutput:insert(specString) 93 | end 94 | 95 | local outpath = cacheDir .. "specSet-" .. n .. ".dat" 96 | local file = io.open(outpath, "w") 97 | io.output(file) 98 | for _, v in ipairs(specSetOutput) do 99 | w(v) 100 | end 101 | io.close(file) 102 | end 103 | 104 | 105 | for i=0, NUM_COMPONENTS do 106 | createCaches(i) 107 | end 108 | -------------------------------------------------------------------------------- /examples/shared/array.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | local C = terralib.includecstring([[ 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | ]]) 37 | 38 | local Array = terralib.memoize(function(T) 39 | local struct A 40 | { 41 | elements : &T; 42 | count : int; 43 | capacity : int; 44 | } 45 | A.methods.init = terralib.overloadedfunction("init") 46 | A.methods.init:adddefinition( 47 | terra(self : &A): {} 48 | C.memset(self, 0, sizeof(A)); 49 | end) 50 | A.methods.init:adddefinition( 51 | terra(self : &A, numElements: int): {} 52 | self:init() 53 | self.count = numElements 54 | self.capacity = numElements 55 | self.elements = [&T](C.realloc(self.elements, self.capacity*terralib.sizeof(T))) 56 | end) 57 | A.methods.init:adddefinition( 58 | terra (self : &A, other : A): {} 59 | self:init(other.count) 60 | if other.count > 0 then 61 | C.memcpy(self.elements, other.elements, other.count * terralib.sizeof(T)) 62 | end 63 | end) 64 | terra A:add( val : T ) 65 | var count = self.count; 66 | var capacity = self.capacity; 67 | var elements = self.elements; 68 | if count == capacity then 69 | if capacity ~= 0 then 70 | capacity = 2 * capacity; 71 | else 72 | capacity = 16; 73 | end 74 | 75 | elements = [&T](C.realloc(self.elements, capacity*terralib.sizeof(T))); 76 | 77 | self.elements = elements; 78 | self.capacity = capacity; 79 | end 80 | var index = count; 81 | count = count + 1; 82 | 83 | elements[index] = val; 84 | 85 | self.count = count; 86 | return index; 87 | end 88 | terra A:get_ptr( idx : int) 89 | return &self.elements[idx]; 90 | end 91 | A.methods.get = macro(function(self, idx) 92 | return `@self:get_ptr(idx) 93 | end) 94 | terra A:trim() 95 | var count = self.count; 96 | if count ~= self.capacity then 97 | self.elements = [&T](C.realloc(self.elements, count*terralib.sizeof(T))); 98 | self.capacity = count 99 | end 100 | end 101 | terra A:getraw() 102 | self:trim() 103 | return self.elements 104 | end 105 | terra A:delete() 106 | C.free(self.elements) 107 | end 108 | return A; 109 | end) 110 | 111 | 112 | return Array; 113 | -------------------------------------------------------------------------------- /examples/shared/d3d11.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | -- d3d11.t 31 | 32 | local D3D11 = terralib.includecstring([[ 33 | #include 34 | #include 35 | #include 36 | #include // for FLT_MAX 37 | ]]) 38 | 39 | -- Note: these are all `#define`s that `includec` can't handle 40 | D3D11.D3D11_SDK_VERSION = 7 41 | D3D11.DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x20; 42 | 43 | local ext = {} 44 | 45 | for k,v in pairs(D3D11) do 46 | local m = string.match(k, "^I?DXGI_?(.*)") 47 | if m then 48 | ext[m] = v; 49 | end 50 | end 51 | 52 | for k,v in pairs(D3D11) do 53 | local m = string.match(k, "^I?D3D1?1?_?(.*)") 54 | if m then 55 | ext[m] = v; 56 | end 57 | end 58 | 59 | setmetatable(ext, {__index = D3D11}) 60 | 61 | return ext; 62 | -------------------------------------------------------------------------------- /examples/shared/map.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | -- A really simple, slow map implementation 31 | local C = terralib.includecstring([[ 32 | #include "stdio.h" 33 | #include "string.h" 34 | ]]) 35 | 36 | local Array = require("array") 37 | 38 | local Map = terralib.memoize(function(K,V, COMP) 39 | if COMP == nil then 40 | COMP = terra(a: K, b: K) return a == b end 41 | end 42 | 43 | local struct M 44 | { 45 | elements : Array(tuple(K,V)) 46 | } 47 | 48 | M.methods.init = terralib.overloadedfunction("init") 49 | M.methods.init:adddefinition( terra(self : &M) : {} 50 | self.elements:init() 51 | end) 52 | 53 | terra M:delete() 54 | self.elements:delete() 55 | end 56 | 57 | terra M:insert(k : K, v : V) 58 | return self.elements:add({k,v}) 59 | end 60 | 61 | local terra find_ptr(m : &M, k : K) 62 | for i=0, m.elements.count do 63 | var v = m.elements:get_ptr(i) 64 | if COMP(v._0, k) then 65 | return &v._1 66 | end 67 | end 68 | return nil 69 | end 70 | 71 | terra M:contains(k : K) 72 | return find_ptr(self, k) ~= nil 73 | end 74 | 75 | terra M:get_ptr(k : K) 76 | var v : &V = find_ptr(self,k) 77 | if v == nil then 78 | var newV : V 79 | v = &self.elements:get(self:insert(k,newV))._1 80 | end 81 | return v 82 | end 83 | 84 | M.metamethods.__apply = macro(function(self, k) 85 | return `@self:get_ptr(k) 86 | end) 87 | 88 | return M 89 | end) 90 | 91 | return Map 92 | -------------------------------------------------------------------------------- /examples/shared/path.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | local struct KeyFrame 31 | { 32 | time : float 33 | pos : vec3 34 | target : vec3 35 | up : vec3 36 | } 37 | 38 | terra KeyFrame:init() 39 | self.time = 0.0f 40 | self.pos = make_vec3(0f,0f,0f) 41 | self.target = make_vec3(0f,0f,1f) 42 | self.up = make_vec3(0f,1f,0f) 43 | end 44 | 45 | return { 46 | KeyFrame = KeyFrame, 47 | } 48 | -------------------------------------------------------------------------------- /examples/shared/sdl.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | -- sdl.t 31 | 32 | local SDLIncludeString = [[ 33 | #undef __SSE__ 34 | #undef __SSE2__ 35 | ]] 36 | SDLIncludeString = SDLIncludeString .. "#include \"" .. SDLPath .. "/include/SDL.h\"\n" 37 | SDLIncludeString = SDLIncludeString .. "#include \"" .. SDLPath .. "/include/SDL_syswm.h\"\n" 38 | SDLIncludeString = SDLIncludeString .. "#include \"" .. SDLPath .. "/include/SDL_opengl.h\"" 39 | local SDL = terralib.includecstring(SDLIncludeString) 40 | 41 | return SDL; 42 | -------------------------------------------------------------------------------- /external/.gitignore: -------------------------------------------------------------------------------- 1 | SDL2/* 2 | -------------------------------------------------------------------------------- /external/assimp/INSTALL: -------------------------------------------------------------------------------- 1 | 2 | ======================================================================== 3 | Open Asset Import Library (assimp) INSTALL 4 | ======================================================================== 5 | 6 | ------------------------------ 7 | Getting the documentation 8 | ------------------------------ 9 | 10 | A regularly-updated copy is available at 11 | http://assimp.sourceforge.net/lib_html/index.html 12 | 13 | A CHM file is included in the SVN repos: ./doc/AssimpDoc_Html/AssimpDoc.chm. 14 | To build the doxygen documentation on your own, follow these steps: 15 | 16 | a) download & install latest doxygen 17 | b) make sure doxygen is in the executable search path 18 | c) navigate to ./doc 19 | d) and run 'doxygen' 20 | 21 | Open the generated HTML (AssimpDoc_Html/index.html) in the browser of your choice. 22 | Windows only: To generate the CHM doc, install 'Microsoft HTML Workshop' 23 | and configure the path to it in the DOXYFILE first. 24 | 25 | ------------------------------ 26 | Building Assimp 27 | ------------------------------ 28 | 29 | More detailed build instructions can be found in the documentation, 30 | this section is just for the inpatient among you. 31 | 32 | CMake is the preferred build system for Assimp. The minimum required version 33 | is 2.6. If you don't have it yet, downloads for CMake can be found on 34 | http://www.cmake.org/. 35 | 36 | For Unix: 37 | 38 | 1. cmake CMakeLists.txt -G 'Unix Makefiles' 39 | 2. make 40 | 41 | For Windows: 42 | 1. Open a command prompt 43 | 2. cmake CMakeLists.txt 44 | 2. Open your default IDE and build it 45 | -------------------------------------------------------------------------------- /external/assimp/LICENSE: -------------------------------------------------------------------------------- 1 | Open Asset Import Library (assimp) 2 | 3 | Copyright (c) 2006-2016, assimp team 4 | All rights reserved. 5 | 6 | Redistribution and use of this software in source and binary forms, 7 | with or without modification, are permitted provided that the 8 | following conditions are met: 9 | 10 | * Redistributions of source code must retain the above 11 | copyright notice, this list of conditions and the 12 | following disclaimer. 13 | 14 | * Redistributions in binary form must reproduce the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer in the documentation and/or other 17 | materials provided with the distribution. 18 | 19 | * Neither the name of the assimp team, nor the names of its 20 | contributors may be used to endorse or promote products 21 | derived from this software without specific prior 22 | written permission of the assimp team. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | 36 | 37 | 38 | ****************************************************************************** 39 | 40 | AN EXCEPTION applies to all files in the ./test/models-nonbsd folder. 41 | These are 3d models for testing purposes, from various free sources 42 | on the internet. They are - unless otherwise stated - copyright of 43 | their respective creators, which may impose additional requirements 44 | on the use of their work. For any of these models, see 45 | .source.txt for more legal information. Contact us if you 46 | are a copyright holder and believe that we credited you inproperly or 47 | if you don't want your files to appear in the repository. 48 | 49 | 50 | ****************************************************************************** 51 | 52 | Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors 53 | http://code.google.com/p/poly2tri/ 54 | 55 | All rights reserved. 56 | Redistribution and use in source and binary forms, with or without modification, 57 | are permitted provided that the following conditions are met: 58 | 59 | * Redistributions of source code must retain the above copyright notice, 60 | this list of conditions and the following disclaimer. 61 | * Redistributions in binary form must reproduce the above copyright notice, 62 | this list of conditions and the following disclaimer in the documentation 63 | and/or other materials provided with the distribution. 64 | * Neither the name of Poly2Tri nor the names of its contributors may be 65 | used to endorse or promote products derived from this software without specific 66 | prior written permission. 67 | 68 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 69 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 70 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 71 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 72 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 73 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 74 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 75 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 76 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 77 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 78 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 79 | -------------------------------------------------------------------------------- /external/assimp/README: -------------------------------------------------------------------------------- 1 | See Readme.md 2 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/.editorconfig: -------------------------------------------------------------------------------- 1 | # See for details 2 | 3 | [*.{h,hpp,inl}] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | indent_size = 4 8 | indent_style = space 9 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/Compiler/poppack1.h: -------------------------------------------------------------------------------- 1 | 2 | // =============================================================================== 3 | // May be included multiple times - resets structure packing to the defaults 4 | // for all supported compilers. Reverts the changes made by #include 5 | // 6 | // Currently this works on the following compilers: 7 | // MSVC 7,8,9 8 | // GCC 9 | // BORLAND (complains about 'pack state changed but not reverted', but works) 10 | // =============================================================================== 11 | 12 | #ifndef AI_PUSHPACK_IS_DEFINED 13 | # error pushpack1.h must be included after poppack1.h 14 | #endif 15 | 16 | // reset packing to the original value 17 | #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 18 | # pragma pack( pop ) 19 | #endif 20 | #undef PACK_STRUCT 21 | 22 | #undef AI_PUSHPACK_IS_DEFINED 23 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/Compiler/pushpack1.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // =============================================================================== 4 | // May be included multiple times - sets structure packing to 1 5 | // for all supported compilers. #include reverts the changes. 6 | // 7 | // Currently this works on the following compilers: 8 | // MSVC 7,8,9 9 | // GCC 10 | // BORLAND (complains about 'pack state changed but not reverted', but works) 11 | // Clang 12 | // 13 | // 14 | // USAGE: 15 | // 16 | // struct StructToBePacked { 17 | // } PACK_STRUCT; 18 | // 19 | // =============================================================================== 20 | 21 | #ifdef AI_PUSHPACK_IS_DEFINED 22 | # error poppack1.h must be included after pushpack1.h 23 | #endif 24 | 25 | #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 26 | # pragma pack(push,1) 27 | # define PACK_STRUCT 28 | #elif defined( __GNUC__ ) 29 | # if !defined(HOST_MINGW) 30 | # define PACK_STRUCT __attribute__((__packed__)) 31 | # else 32 | # define PACK_STRUCT __attribute__((gcc_struct, __packed__)) 33 | # endif 34 | #else 35 | # error Compiler not supported 36 | #endif 37 | 38 | #if defined(_MSC_VER) 39 | // C4103: Packing was changed after the inclusion of the header, probably missing #pragma pop 40 | # pragma warning (disable : 4103) 41 | #endif 42 | 43 | #define AI_PUSHPACK_IS_DEFINED 44 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/DefaultIOSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2017, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file Default implementation of IOSystem using the standard C file functions */ 43 | #ifndef AI_DEFAULTIOSYSTEM_H_INC 44 | #define AI_DEFAULTIOSYSTEM_H_INC 45 | 46 | #include 47 | 48 | namespace Assimp { 49 | 50 | // --------------------------------------------------------------------------- 51 | /** Default implementation of IOSystem using the standard C file functions */ 52 | class ASSIMP_API DefaultIOSystem : public IOSystem 53 | { 54 | public: 55 | /** Constructor. */ 56 | DefaultIOSystem(); 57 | 58 | /** Destructor. */ 59 | ~DefaultIOSystem(); 60 | 61 | // ------------------------------------------------------------------- 62 | /** Tests for the existence of a file at the given path. */ 63 | bool Exists( const char* pFile) const; 64 | 65 | // ------------------------------------------------------------------- 66 | /** Returns the directory separator. */ 67 | char getOsSeparator() const; 68 | 69 | // ------------------------------------------------------------------- 70 | /** Open a new file with a given path. */ 71 | IOStream* Open( const char* pFile, const char* pMode = "rb"); 72 | 73 | // ------------------------------------------------------------------- 74 | /** Closes the given file and releases all resources associated with it. */ 75 | void Close( IOStream* pFile); 76 | 77 | // ------------------------------------------------------------------- 78 | /** Compare two paths */ 79 | bool ComparePaths (const char* one, const char* second) const; 80 | 81 | /** @brief get the file name of a full filepath 82 | * example: /tmp/archive.tar.gz -> archive.tar.gz 83 | */ 84 | static std::string fileName( const std::string &path ); 85 | 86 | /** @brief get the complete base name of a full filepath 87 | * example: /tmp/archive.tar.gz -> archive.tar 88 | */ 89 | static std::string completeBaseName( const std::string &path); 90 | 91 | /** @brief get the path of a full filepath 92 | * example: /tmp/archive.tar.gz -> /tmp/ 93 | */ 94 | static std::string absolutePath( const std::string &path); 95 | }; 96 | 97 | } //!ns Assimp 98 | 99 | #endif //AI_DEFAULTIOSYSTEM_H_INC 100 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/Defines.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2012, assimp team 6 | All rights reserved. 7 | 8 | Redistribution and use of this software in source and binary forms, 9 | with or without modification, are permitted provided that the 10 | following conditions are met: 11 | 12 | * Redistributions of source code must retain the above 13 | copyright notice, this list of conditions and the 14 | following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer in the documentation and/or other 19 | materials provided with the distribution. 20 | 21 | * Neither the name of the assimp team, nor the names of its 22 | contributors may be used to endorse or promote products 23 | derived from this software without specific prior 24 | written permission of the assimp team. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | ---------------------------------------------------------------------- 39 | */ 40 | 41 | // We need those constants, workaround for any platforms where nobody defined them yet 42 | #if (!defined SIZE_MAX) 43 | # define SIZE_MAX (~((size_t)0)) 44 | #endif 45 | 46 | #if (!defined UINT_MAX) 47 | # define UINT_MAX (~((unsigned int)0)) 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/LogStream.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2017, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file LogStream.hpp 43 | * @brief Abstract base class 'LogStream', representing an output log stream. 44 | */ 45 | #ifndef INCLUDED_AI_LOGSTREAM_H 46 | #define INCLUDED_AI_LOGSTREAM_H 47 | 48 | #include "types.h" 49 | 50 | namespace Assimp { 51 | 52 | class IOSystem; 53 | 54 | // ------------------------------------------------------------------------------------ 55 | /** @brief CPP-API: Abstract interface for log stream implementations. 56 | * 57 | * Several default implementations are provided, see #aiDefaultLogStream for more 58 | * details. Writing your own implementation of LogStream is just necessary if these 59 | * are not enough for your purpose. */ 60 | class ASSIMP_API LogStream 61 | #ifndef SWIG 62 | : public Intern::AllocateFromAssimpHeap 63 | #endif 64 | { 65 | protected: 66 | /** @brief Default constructor */ 67 | LogStream(); 68 | 69 | public: 70 | /** @brief Virtual destructor */ 71 | virtual ~LogStream(); 72 | 73 | // ------------------------------------------------------------------- 74 | /** @brief Overwrite this for your own output methods 75 | * 76 | * Log messages *may* consist of multiple lines and you shouldn't 77 | * expect a consistent formatting. If you want custom formatting 78 | * (e.g. generate HTML), supply a custom instance of Logger to 79 | * #DefaultLogger:set(). Usually you can *expect* that a log message 80 | * is exactly one line and terminated with a single \n character. 81 | * @param message Message to be written */ 82 | virtual void write(const char* message) = 0; 83 | 84 | // ------------------------------------------------------------------- 85 | /** @brief Creates a default log stream 86 | * @param streams Type of the default stream 87 | * @param name For aiDefaultLogStream_FILE: name of the output file 88 | * @param io For aiDefaultLogStream_FILE: IOSystem to be used to open the output 89 | * file. Pass NULL for the default implementation. 90 | * @return New LogStream instance. */ 91 | static LogStream* createDefaultStream(aiDefaultLogStream stream, 92 | const char* name = "AssimpLog.txt", 93 | IOSystem* io = NULL); 94 | 95 | }; // !class LogStream 96 | 97 | inline 98 | LogStream::LogStream() { 99 | // empty 100 | } 101 | 102 | inline 103 | LogStream::~LogStream() { 104 | // empty 105 | } 106 | 107 | // ------------------------------------------------------------------------------------ 108 | } // Namespace Assimp 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/NullLogger.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2017, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file NullLogger.hpp 43 | * @brief Dummy logger 44 | */ 45 | 46 | #ifndef INCLUDED_AI_NULLLOGGER_H 47 | #define INCLUDED_AI_NULLLOGGER_H 48 | 49 | #include "Logger.hpp" 50 | 51 | namespace Assimp { 52 | 53 | // --------------------------------------------------------------------------- 54 | /** @brief CPP-API: Empty logging implementation. 55 | * 56 | * Does nothing! Used by default if the application hasn't requested a 57 | * custom logger via #DefaultLogger::set() or #DefaultLogger::create(); */ 58 | class ASSIMP_API NullLogger 59 | : public Logger { 60 | 61 | public: 62 | 63 | /** @brief Logs a debug message */ 64 | void OnDebug(const char* message) { 65 | (void)message; //this avoids compiler warnings 66 | } 67 | 68 | /** @brief Logs an info message */ 69 | void OnInfo(const char* message) { 70 | (void)message; //this avoids compiler warnings 71 | } 72 | 73 | /** @brief Logs a warning message */ 74 | void OnWarn(const char* message) { 75 | (void)message; //this avoids compiler warnings 76 | } 77 | 78 | /** @brief Logs an error message */ 79 | void OnError(const char* message) { 80 | (void)message; //this avoids compiler warnings 81 | } 82 | 83 | /** @brief Detach a still attached stream from logger */ 84 | bool attachStream(LogStream *pStream, unsigned int severity) { 85 | (void)pStream; (void)severity; //this avoids compiler warnings 86 | return false; 87 | } 88 | 89 | /** @brief Detach a still attached stream from logger */ 90 | bool detatchStream(LogStream *pStream, unsigned int severity) { 91 | (void)pStream; (void)severity; //this avoids compiler warnings 92 | return false; 93 | } 94 | 95 | private: 96 | }; 97 | } 98 | #endif // !! AI_NULLLOGGER_H_INCLUDED 99 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/ai_assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | #pragma once 43 | #ifndef AI_ASSERT_H_INC 44 | #define AI_ASSERT_H_INC 45 | 46 | #ifdef ASSIMP_BUILD_DEBUG 47 | # include 48 | # define ai_assert(expression) assert(expression) 49 | #else 50 | # define ai_assert(expression) 51 | #endif // 52 | 53 | #endif // AI_ASSERT_H_INC 54 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/color4.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | /** @file color4.h 43 | * @brief RGBA color structure, including operators when compiling in C++ 44 | */ 45 | #pragma once 46 | #ifndef AI_COLOR4D_H_INC 47 | #define AI_COLOR4D_H_INC 48 | 49 | #include "defs.h" 50 | 51 | #ifdef __cplusplus 52 | 53 | // ---------------------------------------------------------------------------------- 54 | /** Represents a color in Red-Green-Blue space including an 55 | * alpha component. Color values range from 0 to 1. */ 56 | // ---------------------------------------------------------------------------------- 57 | template 58 | class aiColor4t 59 | { 60 | public: 61 | aiColor4t () : r(), g(), b(), a() {} 62 | aiColor4t (TReal _r, TReal _g, TReal _b, TReal _a) 63 | : r(_r), g(_g), b(_b), a(_a) {} 64 | explicit aiColor4t (TReal _r) : r(_r), g(_r), b(_r), a(_r) {} 65 | aiColor4t (const aiColor4t& o) 66 | : r(o.r), g(o.g), b(o.b), a(o.a) {} 67 | 68 | public: 69 | // combined operators 70 | const aiColor4t& operator += (const aiColor4t& o); 71 | const aiColor4t& operator -= (const aiColor4t& o); 72 | const aiColor4t& operator *= (TReal f); 73 | const aiColor4t& operator /= (TReal f); 74 | 75 | public: 76 | // comparison 77 | bool operator == (const aiColor4t& other) const; 78 | bool operator != (const aiColor4t& other) const; 79 | bool operator < (const aiColor4t& other) const; 80 | 81 | // color tuple access, rgba order 82 | inline TReal operator[](unsigned int i) const; 83 | inline TReal& operator[](unsigned int i); 84 | 85 | /** check whether a color is (close to) black */ 86 | inline bool IsBlack() const; 87 | 88 | public: 89 | 90 | // Red, green, blue and alpha color values 91 | TReal r, g, b, a; 92 | }; // !struct aiColor4D 93 | 94 | typedef aiColor4t aiColor4D; 95 | 96 | #else 97 | 98 | struct aiColor4D { 99 | ai_real r, g, b, a; 100 | }; 101 | 102 | #endif // __cplusplus 103 | 104 | #endif // AI_COLOR4D_H_INC 105 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2016, assimp team 6 | All rights reserved. 7 | 8 | Redistribution and use of this software in source and binary forms, 9 | with or without modification, are permitted provided that the 10 | following conditions are met: 11 | 12 | * Redistributions of source code must retain the above 13 | copyright notice, this list of conditions and the 14 | following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer in the documentation and/or other 19 | materials provided with the distribution. 20 | 21 | * Neither the name of the assimp team, nor the names of its 22 | contributors may be used to endorse or promote products 23 | derived from this software without specific prior 24 | written permission of the assimp team. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | ---------------------------------------------------------------------- 39 | */ 40 | 41 | /** @file Android implementation of IOSystem using the standard C file functions. 42 | * Aimed to ease the access to android assets */ 43 | 44 | #if __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT) 45 | #ifndef AI_ANDROIDJNIIOSYSTEM_H_INC 46 | #define AI_ANDROIDJNIIOSYSTEM_H_INC 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | namespace Assimp { 54 | 55 | // --------------------------------------------------------------------------- 56 | /** Android extension to DefaultIOSystem using the standard C file functions */ 57 | class ASSIMP_API AndroidJNIIOSystem : public DefaultIOSystem 58 | { 59 | public: 60 | 61 | /** Initialize android activity data */ 62 | std::string mApkWorkspacePath; 63 | AAssetManager* mApkAssetManager; 64 | 65 | /** Constructor. */ 66 | AndroidJNIIOSystem(ANativeActivity* activity); 67 | 68 | /** Destructor. */ 69 | ~AndroidJNIIOSystem(); 70 | 71 | // ------------------------------------------------------------------- 72 | /** Tests for the existence of a file at the given path. */ 73 | bool Exists( const char* pFile) const; 74 | 75 | // ------------------------------------------------------------------- 76 | /** Opens a file at the given path, with given mode */ 77 | IOStream* Open( const char* strFile, const char* strMode); 78 | 79 | // ------------------------------------------------------------------------------------------------ 80 | // Inits Android extractor 81 | void AndroidActivityInit(ANativeActivity* activity); 82 | 83 | // ------------------------------------------------------------------------------------------------ 84 | // Extracts android asset 85 | bool AndroidExtractAsset(std::string name); 86 | 87 | }; 88 | 89 | } //!ns Assimp 90 | 91 | #endif //AI_ANDROIDJNIIOSYSTEM_H_INC 92 | #endif //__ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT) 93 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/quaternion.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2017, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file quaternion.h 43 | * @brief Quaternion structure, including operators when compiling in C++ 44 | */ 45 | #pragma once 46 | #ifndef AI_QUATERNION_H_INC 47 | #define AI_QUATERNION_H_INC 48 | 49 | #ifdef __cplusplus 50 | 51 | #include "defs.h" 52 | 53 | template class aiVector3t; 54 | template class aiMatrix3x3t; 55 | 56 | // --------------------------------------------------------------------------- 57 | /** Represents a quaternion in a 4D vector. */ 58 | template 59 | class aiQuaterniont 60 | { 61 | public: 62 | aiQuaterniont() : w(1.0), x(), y(), z() {} 63 | aiQuaterniont(TReal pw, TReal px, TReal py, TReal pz) 64 | : w(pw), x(px), y(py), z(pz) {} 65 | 66 | /** Construct from rotation matrix. Result is undefined if the matrix is not orthonormal. */ 67 | explicit aiQuaterniont( const aiMatrix3x3t& pRotMatrix); 68 | 69 | /** Construct from euler angles */ 70 | aiQuaterniont( TReal rotx, TReal roty, TReal rotz); 71 | 72 | /** Construct from an axis-angle pair */ 73 | aiQuaterniont( aiVector3t axis, TReal angle); 74 | 75 | /** Construct from a normalized quaternion stored in a vec3 */ 76 | explicit aiQuaterniont( aiVector3t normalized); 77 | 78 | /** Returns a matrix representation of the quaternion */ 79 | aiMatrix3x3t GetMatrix() const; 80 | 81 | public: 82 | 83 | bool operator== (const aiQuaterniont& o) const; 84 | bool operator!= (const aiQuaterniont& o) const; 85 | 86 | bool Equal(const aiQuaterniont& o, TReal epsilon = 1e-6) const; 87 | 88 | public: 89 | 90 | /** Normalize the quaternion */ 91 | aiQuaterniont& Normalize(); 92 | 93 | /** Compute quaternion conjugate */ 94 | aiQuaterniont& Conjugate (); 95 | 96 | /** Rotate a point by this quaternion */ 97 | aiVector3t Rotate (const aiVector3t& in); 98 | 99 | /** Multiply two quaternions */ 100 | aiQuaterniont operator* (const aiQuaterniont& two) const; 101 | 102 | public: 103 | 104 | /** Performs a spherical interpolation between two quaternions and writes the result into the third. 105 | * @param pOut Target object to received the interpolated rotation. 106 | * @param pStart Start rotation of the interpolation at factor == 0. 107 | * @param pEnd End rotation, factor == 1. 108 | * @param pFactor Interpolation factor between 0 and 1. Values outside of this range yield undefined results. 109 | */ 110 | static void Interpolate( aiQuaterniont& pOut, const aiQuaterniont& pStart, 111 | const aiQuaterniont& pEnd, TReal pFactor); 112 | 113 | public: 114 | 115 | //! w,x,y,z components of the quaternion 116 | TReal w, x, y, z; 117 | } ; 118 | 119 | typedef aiQuaterniont aiQuaternion; 120 | 121 | #else 122 | 123 | struct aiQuaternion { 124 | ai_real w, x, y, z; 125 | }; 126 | 127 | #endif 128 | 129 | #endif // AI_QUATERNION_H_INC 130 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/vector2.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | /** @file vector2.h 43 | * @brief 2D vector structure, including operators when compiling in C++ 44 | */ 45 | #pragma once 46 | #ifndef AI_VECTOR2D_H_INC 47 | #define AI_VECTOR2D_H_INC 48 | 49 | #ifdef __cplusplus 50 | # include 51 | #else 52 | # include 53 | #endif 54 | 55 | #include "./Compiler/pushpack1.h" 56 | #include "defs.h" 57 | 58 | // ---------------------------------------------------------------------------------- 59 | /** Represents a two-dimensional vector. 60 | */ 61 | 62 | #ifdef __cplusplus 63 | template 64 | class aiVector2t 65 | { 66 | public: 67 | 68 | aiVector2t () : x(), y() {} 69 | aiVector2t (TReal _x, TReal _y) : x(_x), y(_y) {} 70 | explicit aiVector2t (TReal _xyz) : x(_xyz), y(_xyz) {} 71 | aiVector2t (const aiVector2t& o) : x(o.x), y(o.y) {} 72 | 73 | public: 74 | 75 | void Set( TReal pX, TReal pY); 76 | TReal SquareLength() const ; 77 | TReal Length() const ; 78 | aiVector2t& Normalize(); 79 | 80 | public: 81 | 82 | const aiVector2t& operator += (const aiVector2t& o); 83 | const aiVector2t& operator -= (const aiVector2t& o); 84 | const aiVector2t& operator *= (TReal f); 85 | const aiVector2t& operator /= (TReal f); 86 | 87 | TReal operator[](unsigned int i) const; 88 | TReal& operator[](unsigned int i); 89 | 90 | bool operator== (const aiVector2t& other) const; 91 | bool operator!= (const aiVector2t& other) const; 92 | 93 | bool Equal(const aiVector2t& other, TReal epsilon = 1e-6) const; 94 | 95 | aiVector2t& operator= (TReal f); 96 | const aiVector2t SymMul(const aiVector2t& o); 97 | 98 | template 99 | operator aiVector2t () const; 100 | 101 | TReal x, y; 102 | } PACK_STRUCT; 103 | 104 | typedef aiVector2t aiVector2D; 105 | 106 | #else 107 | 108 | struct aiVector2D { 109 | ai_real x, y; 110 | }; 111 | 112 | #endif // __cplusplus 113 | 114 | #include "./Compiler/poppack1.h" 115 | 116 | #endif // AI_VECTOR2D_H_INC 117 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/vector3.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | /** @file vector3.h 43 | * @brief 3D vector structure, including operators when compiling in C++ 44 | */ 45 | #pragma once 46 | #ifndef AI_VECTOR3D_H_INC 47 | #define AI_VECTOR3D_H_INC 48 | 49 | #ifdef __cplusplus 50 | # include 51 | #else 52 | # include 53 | #endif 54 | 55 | #include "defs.h" 56 | 57 | #ifdef __cplusplus 58 | 59 | template class aiMatrix3x3t; 60 | template class aiMatrix4x4t; 61 | 62 | // --------------------------------------------------------------------------- 63 | /** Represents a three-dimensional vector. */ 64 | template 65 | class aiVector3t 66 | { 67 | public: 68 | aiVector3t() : x(), y(), z() {} 69 | aiVector3t(TReal _x, TReal _y, TReal _z) : x(_x), y(_y), z(_z) {} 70 | explicit aiVector3t (TReal _xyz ) : x(_xyz), y(_xyz), z(_xyz) {} 71 | aiVector3t( const aiVector3t& o ) : x(o.x), y(o.y), z(o.z) {} 72 | 73 | public: 74 | 75 | // combined operators 76 | const aiVector3t& operator += (const aiVector3t& o); 77 | const aiVector3t& operator -= (const aiVector3t& o); 78 | const aiVector3t& operator *= (TReal f); 79 | const aiVector3t& operator /= (TReal f); 80 | 81 | // transform vector by matrix 82 | aiVector3t& operator *= (const aiMatrix3x3t& mat); 83 | aiVector3t& operator *= (const aiMatrix4x4t& mat); 84 | 85 | // access a single element 86 | TReal operator[](unsigned int i) const; 87 | TReal& operator[](unsigned int i); 88 | 89 | // comparison 90 | bool operator== (const aiVector3t& other) const; 91 | bool operator!= (const aiVector3t& other) const; 92 | bool operator < (const aiVector3t& other) const; 93 | 94 | bool Equal(const aiVector3t& other, TReal epsilon = 1e-6) const; 95 | 96 | template 97 | operator aiVector3t () const; 98 | 99 | public: 100 | /** @brief Set the components of a vector 101 | * @param pX X component 102 | * @param pY Y component 103 | * @param pZ Z component */ 104 | void Set( TReal pX, TReal pY, TReal pZ); 105 | 106 | /** @brief Get the squared length of the vector 107 | * @return Square length */ 108 | TReal SquareLength() const; 109 | 110 | /** @brief Get the length of the vector 111 | * @return length */ 112 | TReal Length() const; 113 | 114 | 115 | /** @brief Normalize the vector */ 116 | aiVector3t& Normalize(); 117 | 118 | /** @brief Normalize the vector with extra check for zero vectors */ 119 | aiVector3t& NormalizeSafe(); 120 | 121 | /** @brief Componentwise multiplication of two vectors 122 | * 123 | * Note that vec*vec yields the dot product. 124 | * @param o Second factor */ 125 | const aiVector3t SymMul(const aiVector3t& o); 126 | 127 | TReal x, y, z; 128 | }; 129 | 130 | 131 | typedef aiVector3t aiVector3D; 132 | 133 | #else 134 | 135 | struct aiVector3D { 136 | ai_real x, y, z; 137 | }; 138 | 139 | #endif // __cplusplus 140 | 141 | #ifdef __cplusplus 142 | 143 | #endif // __cplusplus 144 | 145 | #endif // AI_VECTOR3D_H_INC 146 | -------------------------------------------------------------------------------- /external/assimp/include/assimp/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file version.h 44 | * @brief Functions to query the version of the Assimp runtime, check 45 | * compile flags, ... 46 | */ 47 | #pragma once 48 | #ifndef AI_VERSION_H_INC 49 | #define AI_VERSION_H_INC 50 | 51 | #include "defs.h" 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | // --------------------------------------------------------------------------- 58 | /** @brief Returns a string with legal copyright and licensing information 59 | * about Assimp. The string may include multiple lines. 60 | * @return Pointer to static string. 61 | */ 62 | ASSIMP_API const char* aiGetLegalString (void); 63 | 64 | // --------------------------------------------------------------------------- 65 | /** @brief Returns the current minor version number of Assimp. 66 | * @return Minor version of the Assimp runtime the application was 67 | * linked/built against 68 | */ 69 | ASSIMP_API unsigned int aiGetVersionMinor (void); 70 | 71 | // --------------------------------------------------------------------------- 72 | /** @brief Returns the current major version number of Assimp. 73 | * @return Major version of the Assimp runtime the application was 74 | * linked/built against 75 | */ 76 | ASSIMP_API unsigned int aiGetVersionMajor (void); 77 | 78 | // --------------------------------------------------------------------------- 79 | /** @brief Returns the repository revision of the Assimp runtime. 80 | * @return SVN Repository revision number of the Assimp runtime the 81 | * application was linked/built against. 82 | */ 83 | ASSIMP_API unsigned int aiGetVersionRevision (void); 84 | 85 | //! Assimp was compiled as a shared object (Windows: DLL) 86 | #define ASSIMP_CFLAGS_SHARED 0x1 87 | //! Assimp was compiled against STLport 88 | #define ASSIMP_CFLAGS_STLPORT 0x2 89 | //! Assimp was compiled as a debug build 90 | #define ASSIMP_CFLAGS_DEBUG 0x4 91 | 92 | //! Assimp was compiled with ASSIMP_BUILD_BOOST_WORKAROUND defined 93 | #define ASSIMP_CFLAGS_NOBOOST 0x8 94 | //! Assimp was compiled with ASSIMP_BUILD_SINGLETHREADED defined 95 | #define ASSIMP_CFLAGS_SINGLETHREADED 0x10 96 | 97 | // --------------------------------------------------------------------------- 98 | /** @brief Returns assimp's compile flags 99 | * @return Any bitwise combination of the ASSIMP_CFLAGS_xxx constants. 100 | */ 101 | ASSIMP_API unsigned int aiGetCompileFlags (void); 102 | 103 | #ifdef __cplusplus 104 | } // end extern "C" 105 | #endif 106 | 107 | #endif // !! #ifndef AI_VERSION_H_INC 108 | 109 | -------------------------------------------------------------------------------- /external/built/.gitignore: -------------------------------------------------------------------------------- 1 | !*.lib 2 | !*.dll 3 | -------------------------------------------------------------------------------- /external/built/bin/x64/assimp-vc120-mt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/built/bin/x64/assimp-vc120-mt.dll -------------------------------------------------------------------------------- /external/built/bin/x64/cimgui.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/built/bin/x64/cimgui.dll -------------------------------------------------------------------------------- /external/built/bin/x64/stbi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/built/bin/x64/stbi.dll -------------------------------------------------------------------------------- /external/built/lib/x64/assimp-vc120-mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/built/lib/x64/assimp-vc120-mt.lib -------------------------------------------------------------------------------- /external/built/lib/x64/cimgui.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/built/lib/x64/cimgui.lib -------------------------------------------------------------------------------- /external/built/lib/x64/stbi.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/built/lib/x64/stbi.lib -------------------------------------------------------------------------------- /external/built/stb_image.c: -------------------------------------------------------------------------------- 1 | // Use this file to compile stb_image.h to a DLL and/or LIB. 2 | // In stb_image.h, change the #define STBIDEF line to include __declspec(dllexport) 3 | // before compiling. 4 | 5 | // Use the following command line to compile to a DLL: 6 | // cl.exe /DSTB_IMAGE_IMPLEMENTATION /I..\stb stb_image.c /link /out:x64\stbi.dll /DLL 7 | 8 | // Use the following command line to compile to a SO: 9 | // gcc -I../stb/ -DSTB_IMAGE_IMPLEMENTATION -shared -o x64/libSTBI.so -fPIC stb_image.c 10 | 11 | // Use the following command line to compile to a Linux .a 12 | // gcc -I../stb/ -DSTB_IMAGE_IMPLEMENTATION -c -o stb_image.o stb_image.c 13 | // ar rcs x64/libSTBI.a stb_image.o 14 | 15 | #include "stb_image.h" 16 | -------------------------------------------------------------------------------- /external/cimgui/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | 19 | # Compiled Static libraries 20 | *.lai 21 | *.la 22 | *.a 23 | *.lib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | cimgui/Debug/ 30 | cimgui/cimgui.opensdf 31 | cimgui/cimgui.sdf 32 | cimgui/cimgui.v12.suo 33 | cimgui/Release/ 34 | .idea 35 | CMakeLists.txt 36 | cimgui/.vs/ 37 | cimgui/cimgui.vcxproj.user 38 | -------------------------------------------------------------------------------- /external/cimgui/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "imgui"] 2 | path = imgui 3 | url = https://github.com/ocornut/imgui.git 4 | -------------------------------------------------------------------------------- /external/cimgui/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | os: 4 | - linux 5 | 6 | compiler: 7 | - gcc 8 | - clang 9 | 10 | script: 11 | - make -C cimgui 12 | -------------------------------------------------------------------------------- /external/cimgui/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Stephan Dilly 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /external/cimgui/README.md: -------------------------------------------------------------------------------- 1 | # cimgui [![Build Status](https://travis-ci.org/Extrawurst/cimgui.svg)](https://travis-ci.org/Extrawurst/cimgui) 2 | 3 | ![sample](https://raw.github.com/extrawurst/cimgui/master/Screen Shot 2015-04-09.png) 4 | ![new menus api](https://raw.github.com/extrawurst/cimgui/master/menus-api.gif) 5 | 6 | This is a thin c-api wrapper for the excellent C++ intermediate gui [imgui](https://github.com/ocornut/imgui). 7 | Most of the functions have wrapper counterparts now, missing stuff is added on a as-needed basis (PR welcome). 8 | This library is intended as a intermediate layer to be able to use imgui from other languages that can interface with C (like D - see [D-binding](https://github.com/Extrawurst/DerelictImgui)) 9 | 10 | Notes: 11 | * currently this wrapper is based on version [1.45 of imgui](https://github.com/ocornut/imgui/releases/tag/v1.45) 12 | * does not compile with pure C compiler yet (for writing bindings in languages that are able to use C-ABI it is enough though, see D-bindings) 13 | 14 | # usage 15 | 16 | * clone 17 | * make using makefile on linux/osx 18 | * use whatever method is in ImGui c++ namespace in the original [imgui.h](https://github.com/ocornut/imgui/blob/master/imgui.h) by prepending `ig` 19 | * methods have the same parameter list and return values (where possible) 20 | -------------------------------------------------------------------------------- /external/cimgui/Screen Shot 2015-04-09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/cimgui/Screen Shot 2015-04-09.png -------------------------------------------------------------------------------- /external/cimgui/cimgui/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with Ubuntu 14.04.1 and Mac OS X 4 | 5 | OBJS = cimgui.o 6 | OBJS += fontAtlas.o 7 | OBJS += drawList.o 8 | #OBJS += test.o 9 | OBJS += ../imgui/imgui.o 10 | OBJS += ../imgui/imgui_draw.o 11 | OBJS += ../imgui/imgui_demo.o 12 | OBJS += ../imgui/examples/sdl_opengl_example/imgui_impl_sdl.o 13 | 14 | UNAME_S := $(shell uname -s) 15 | 16 | ifeq ($(UNAME_S), Linux) #LINUX 17 | ECHO_MESSAGE = "Linux" 18 | 19 | OUTPUTNAME = cimgui.so 20 | OUTPUTNAMESTATIC = cimgui.a 21 | CXXFLAGS = -I../imgui/ 22 | CXXFLAGS += -I../../SDL2/include/ 23 | CXXFLAGS += -Wall 24 | CXXFLAGS += -shared -fPIC 25 | CFLAGS = $(CXXFLAGS) 26 | endif 27 | 28 | ifeq ($(UNAME_S), Darwin) #APPLE 29 | ECHO_MESSAGE = "Mac OS X" 30 | 31 | OUTPUTNAME = cimgui.dylib 32 | CXXFLAGS = -I/usr/local/include 33 | CXXFLAGS += -Wall 34 | LINKFLAGS = -dynamiclib 35 | CFLAGS = $(CXXFLAGS) 36 | endif 37 | 38 | .cpp.o: 39 | $(CXX) $(CXXFLAGS) -c -o $@ $< 40 | 41 | all:imgui_example 42 | @echo Build complete for $(ECHO_MESSAGE) 43 | 44 | imgui_example:$(OBJS) 45 | $(CXX) -o $(OUTPUTNAME) $(OBJS) $(CXXFLAGS) $(LINKFLAGS) 46 | ar rcs $(OUTPUTNAMESTATIC) $(OBJS) 47 | 48 | clean: 49 | rm $(OBJS) 50 | -------------------------------------------------------------------------------- /external/cimgui/cimgui/cimgui.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cimgui", "cimgui.vcxproj", "{EDE48926-0595-4488-B1A0-32CA71397271}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Debug|x64 = Debug|x64 10 | Release|Win32 = Release|Win32 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {EDE48926-0595-4488-B1A0-32CA71397271}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {EDE48926-0595-4488-B1A0-32CA71397271}.Debug|Win32.Build.0 = Debug|Win32 16 | {EDE48926-0595-4488-B1A0-32CA71397271}.Debug|x64.ActiveCfg = Debug|x64 17 | {EDE48926-0595-4488-B1A0-32CA71397271}.Debug|x64.Build.0 = Debug|x64 18 | {EDE48926-0595-4488-B1A0-32CA71397271}.Release|Win32.ActiveCfg = Release|Win32 19 | {EDE48926-0595-4488-B1A0-32CA71397271}.Release|Win32.Build.0 = Release|Win32 20 | {EDE48926-0595-4488-B1A0-32CA71397271}.Release|x64.ActiveCfg = Release|x64 21 | {EDE48926-0595-4488-B1A0-32CA71397271}.Release|x64.Build.0 = Release|x64 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /external/cimgui/cimgui/cimgui.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | -------------------------------------------------------------------------------- /external/cimgui/cimgui/drawList.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "../imgui/imgui.h" 3 | #include "cimgui.h" 4 | 5 | CIMGUI_API int ImDrawList_GetVertexBufferSize(ImDrawList* list) 6 | { 7 | return list->VtxBuffer.size(); 8 | } 9 | 10 | CIMGUI_API ImDrawVert* ImDrawList_GetVertexPtr(ImDrawList* list, int n) 11 | { 12 | return &list->VtxBuffer[n]; 13 | } 14 | 15 | CIMGUI_API int ImDrawList_GetIndexBufferSize(ImDrawList* list) 16 | { 17 | return list->IdxBuffer.size(); 18 | } 19 | 20 | CIMGUI_API ImDrawIdx* ImDrawList_GetIndexPtr(ImDrawList* list, int n) 21 | { 22 | return &list->IdxBuffer[n]; 23 | } 24 | 25 | CIMGUI_API int ImDrawList_GetCmdSize(ImDrawList* list) 26 | { 27 | return list->CmdBuffer.size(); 28 | } 29 | 30 | CIMGUI_API ImDrawCmd* ImDrawList_GetCmdPtr(ImDrawList* list, int n) 31 | { 32 | return &list->CmdBuffer[n]; 33 | } 34 | 35 | CIMGUI_API void ImDrawData_DeIndexAllBuffers(ImDrawData* drawData) 36 | { 37 | return drawData->DeIndexAllBuffers(); 38 | } -------------------------------------------------------------------------------- /external/cimgui/cimgui/fontAtlas.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "../imgui/imgui.h" 3 | #include "cimgui.h" 4 | 5 | CIMGUI_API void ImFontAtlas_GetTexDataAsRGBA32(ImFontAtlas* atlas, unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel) 6 | { 7 | atlas->GetTexDataAsRGBA32(out_pixels, out_width, out_height, out_bytes_per_pixel); 8 | } 9 | 10 | CIMGUI_API void ImFontAtlas_GetTexDataAsAlpha8(ImFontAtlas* atlas, unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel) 11 | { 12 | atlas->GetTexDataAsAlpha8(out_pixels, out_width, out_height, out_bytes_per_pixel); 13 | } 14 | 15 | CIMGUI_API void ImFontAtlas_SetTexID(ImFontAtlas* atlas, void* tex) 16 | { 17 | atlas->TexID = tex; 18 | } 19 | 20 | CIMGUI_API ImFont* ImFontAtlas_AddFont(ImFontAtlas* atlas, CONST ImFontConfig* font_cfg) 21 | { 22 | return atlas->AddFont(font_cfg); 23 | } 24 | 25 | CIMGUI_API ImFont* ImFontAtlas_AddFontDefault(ImFontAtlas* atlas, CONST ImFontConfig* font_cfg) 26 | { 27 | return atlas->AddFontDefault(font_cfg); 28 | } 29 | 30 | CIMGUI_API ImFont* ImFontAtlas_AddFontFromFileTTF(ImFontAtlas* atlas,CONST char* filename, float size_pixels, CONST ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges) 31 | { 32 | return atlas->AddFontFromFileTTF(filename, size_pixels, font_cfg, glyph_ranges); 33 | } 34 | 35 | CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryTTF(ImFontAtlas* atlas, void* ttf_data, int ttf_size, float size_pixels, CONST ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges) 36 | { 37 | return atlas->AddFontFromMemoryTTF(ttf_data, ttf_size, size_pixels, font_cfg, glyph_ranges); 38 | } 39 | 40 | CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* atlas, CONST void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, CONST ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges) 41 | { 42 | return atlas->AddFontFromMemoryCompressedTTF(compressed_ttf_data, compressed_ttf_size, size_pixels, font_cfg, glyph_ranges); 43 | } 44 | 45 | CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas* atlas, CONST char* compressed_ttf_data_base85, float size_pixels, CONST ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges) 46 | { 47 | return atlas->AddFontFromMemoryCompressedBase85TTF(compressed_ttf_data_base85, size_pixels, font_cfg, glyph_ranges); 48 | } 49 | 50 | CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* atlas) 51 | { 52 | return atlas->ClearTexData(); 53 | } 54 | 55 | CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* atlas) 56 | { 57 | return atlas->Clear(); 58 | } -------------------------------------------------------------------------------- /external/cimgui/cimgui/test.c: -------------------------------------------------------------------------------- 1 | 2 | #include "cimgui.h" -------------------------------------------------------------------------------- /external/cimgui/imgui/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | os: 4 | - linux 5 | 6 | compiler: 7 | - gcc 8 | - clang 9 | 10 | before_install: 11 | - if [ $TRAVIS_OS_NAME == linux ]; then sudo add-apt-repository -y ppa:pyglfw/pyglfw && sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends libglfw3-dev libxrandr-dev libxi-dev libxxf86vm-dev; fi 12 | - if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install glfw3; fi 13 | 14 | script: 15 | - make -C examples/opengl_example 16 | - make -C examples/opengl3_example 17 | 18 | -------------------------------------------------------------------------------- /external/cimgui/imgui/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2015 Omar Cornut and ImGui contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/.gitignore: -------------------------------------------------------------------------------- 1 | ## Visual Studio files 2 | Debug/* 3 | Release/* 4 | ipch/* 5 | x64/* 6 | directx9_example/Debug/* 7 | directx9_example/Release/* 8 | directx9_example/ipch/* 9 | directx9_example/x64/* 10 | directx11_example/Debug/* 11 | directx11_example/Release/* 12 | directx11_example/ipch/* 13 | directx11_example/x64/* 14 | opengl_example/Debug/* 15 | opengl_example/Release/* 16 | opengl_example/ipch/* 17 | opengl_example/x64/* 18 | opengl_example/opengl_example 19 | opengl3_example/Debug/* 20 | opengl3_example/Release/* 21 | opengl3_example/ipch/* 22 | opengl3_example/x64/* 23 | opengl3_example/opengl3_example 24 | *.opensdf 25 | *.sdf 26 | *.suo 27 | *.vcxproj.user 28 | *.o 29 | *.obj 30 | *.exe 31 | 32 | ## Ini files 33 | imgui.ini 34 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/README.txt: -------------------------------------------------------------------------------- 1 | Those are standalone ready-to-build applications to demonstrate ImGui. 2 | Binaries of some of those demos are available at http://www.miracleworld.net/imgui/binaries 3 | 4 | TL;DR; 5 | Refer to 'opengl_example' to understand how the library is setup, because it is the simplest one. 6 | Copy the imgui_impl_xxx.cpp/.h files you need if you are using one of provided rendering/IO backends. 7 | If using different or your own backend, copy opengl_example/imgui_impl_opengl.cpp/.h to get started. 8 | 9 | 10 | ImGui is highly portable and only requires a few things to run: 11 | - Providing mouse/keyboard inputs 12 | - Load the font atlas texture into GPU memory 13 | - Providing a render function to render indexed textured triangles 14 | - Optional: clipboard support, mouse cursor supports, Windows IME support, etc. 15 | So this is essentially what those examples are doing + the obligatory cruft for portability. 16 | 17 | Unfortunately in 2015 it is still tedious to create and maintain portable build files using external 18 | libraries (the kind we're using here to create a window and render 3D triangles) without relying on 19 | third party software. For most examples here I choose to provide: 20 | - Makefiles for Linux/OSX 21 | - Batch files for Visual Studio 2008+ 22 | - A .sln project file for Visual Studio 2010+ 23 | Please let me know if they don't work with your setup! 24 | You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those 25 | directly with a command-line compiler. 26 | 27 | opengl_example/ 28 | OpenGL example, using GLFW + fixed pipeline. 29 | This is simple and should work for all OpenGL enabled applications. 30 | Prefer following this example to learn how ImGui works! 31 | (You can use this code in a GL3/GL4 context but make sure you disable the programmable pipeline 32 | by calling "glUseProgram(0)" before ImGui::Render.) 33 | 34 | opengl3_example/ 35 | OpenGL example, using GLFW/GL3W + programmable pipeline. 36 | This uses more modern OpenGL calls and custom shaders. It's more messy. 37 | 38 | directx9_example/ 39 | DirectX9 example, Windows only. 40 | 41 | directx11_example/ 42 | DirectX11 example, Windows only. 43 | This is quite long and tedious, because: DirectX11. 44 | 45 | ios_example/ 46 | iOS example. 47 | Using Synergy to access keyboard/mouse data from server computer. 48 | Synergy keyboard integration is rather hacky. 49 | 50 | sdl_opengl_example/ 51 | SDL2 + OpenGL example. 52 | 53 | allegro5_example/ 54 | Allegro 5 example. 55 | 56 | marmalade_example/ 57 | Marmalade example using IwGx 58 | 59 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/allegro5_example/README.md: -------------------------------------------------------------------------------- 1 | 2 | # How to Build 3 | 4 | - On Ubuntu 14.04+ 5 | 6 | ```bash 7 | g++ -I ../imgui main.cpp imgui_impl_a5.cpp ../imgui/imgui*.cpp -lallegro -lallegro_primitives 8 | ``` 9 | 10 | - On Windows with Visual Studio's CLI 11 | 12 | \ is your allegro5 folder. 13 | 14 | ``` 15 | cl /MD /I /I ..\imgui main.cpp imgui_impl_a5.cpp ..\imgui\imgui*.cpp /link /LIBPATH: allegro-5.0.10-monolith-md.lib user32.lib 16 | ``` 17 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/allegro5_example/imgui_impl_a5.h: -------------------------------------------------------------------------------- 1 | // ImGui Allegro 5 bindings 2 | // You can copy and use unmodified imgui_impl_* files in your project. 3 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 4 | // See main.cpp for an example of using this. 5 | // https://github.com/ocornut/imgui 6 | // by @birthggd 7 | 8 | #pragma once 9 | 10 | struct ALLEGRO_DISPLAY; 11 | union ALLEGRO_EVENT; 12 | 13 | IMGUI_API bool ImGui_ImplA5_Init(ALLEGRO_DISPLAY* display); 14 | IMGUI_API void ImGui_ImplA5_Shutdown(); 15 | IMGUI_API void ImGui_ImplA5_NewFrame(); 16 | IMGUI_API bool ImGui_ImplA5_ProcessEvent(ALLEGRO_EVENT* event); 17 | 18 | // Use if you want to reset your rendering device without losing ImGui state. 19 | IMGUI_API bool Imgui_ImplA5_CreateDeviceObjects(); 20 | IMGUI_API void ImGui_ImplA5_InvalidateDeviceObjects(); 21 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/allegro5_example/main.cpp: -------------------------------------------------------------------------------- 1 | // ImGui - standalone example application for Allegro 5 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "imgui_impl_a5.h" 8 | 9 | int main(int, char**) 10 | { 11 | // Setup Allegro 12 | al_init(); 13 | al_install_keyboard(); 14 | al_install_mouse(); 15 | al_init_primitives_addon(); 16 | al_set_new_display_flags(ALLEGRO_RESIZABLE); 17 | ALLEGRO_DISPLAY* display = al_create_display(1280, 720); 18 | al_set_window_title(display, "ImGui Allegro 5 example"); 19 | ALLEGRO_EVENT_QUEUE* queue = al_create_event_queue(); 20 | al_register_event_source(queue, al_get_display_event_source(display)); 21 | al_register_event_source(queue, al_get_keyboard_event_source()); 22 | al_register_event_source(queue, al_get_mouse_event_source()); 23 | 24 | // Setup ImGui binding 25 | ImGui_ImplA5_Init(display); 26 | 27 | // Load Fonts 28 | // (see extra_fonts/README.txt for more details) 29 | //ImGuiIO& io = ImGui::GetIO(); 30 | //io.Fonts->AddFontDefault(); 31 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/Cousine-Regular.ttf", 15.0f); 32 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f); 33 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f); 34 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f); 35 | //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese()); 36 | 37 | // Merge glyphs from multiple fonts into one (e.g. combine default font with another with Chinese glyphs, or add icons) 38 | //ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 }; 39 | //ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true; 40 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 18.0f); 41 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/fontawesome-webfont.ttf", 18.0f, &icons_config, icons_ranges); 42 | 43 | bool show_test_window = true; 44 | bool show_another_window = false; 45 | ImVec4 clear_color = ImColor(114, 144, 154); 46 | 47 | // Main loop 48 | bool running = true; 49 | while (running) 50 | { 51 | ALLEGRO_EVENT ev; 52 | while (al_get_next_event(queue, &ev)) 53 | { 54 | ImGui_ImplA5_ProcessEvent(&ev); 55 | if (ev.type == ALLEGRO_EVENT_DISPLAY_CLOSE) running = false; 56 | if (ev.type == ALLEGRO_EVENT_DISPLAY_RESIZE) 57 | { 58 | ImGui_ImplA5_InvalidateDeviceObjects(); 59 | al_acknowledge_resize(display); 60 | Imgui_ImplA5_CreateDeviceObjects(); 61 | } 62 | } 63 | ImGui_ImplA5_NewFrame(); 64 | 65 | // 1. Show a simple window 66 | // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug" 67 | { 68 | static float f; 69 | ImGui::Text("Hello, world!"); 70 | ImGui::SliderFloat("float", &f, 0.0f, 1.0f); 71 | ImGui::ColorEdit3("clear color", (float*)&clear_color); 72 | if (ImGui::Button("Test Window")) show_test_window ^= 1; 73 | if (ImGui::Button("Another Window")) show_another_window ^= 1; 74 | ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f/ImGui::GetIO().Framerate, ImGui::GetIO().Framerate); 75 | } 76 | 77 | // 2. Show another simple window, this time using an explicit Begin/End pair 78 | if (show_another_window) 79 | { 80 | ImGui::SetNextWindowSize(ImVec2(200, 100), ImGuiSetCond_FirstUseEver); 81 | ImGui::Begin("Another Window", &show_another_window); 82 | ImGui::Text("Hello"); 83 | ImGui::End(); 84 | } 85 | 86 | // 3. Show the ImGui test window. Most of the sample code is in ImGui::ShowTestWindow() 87 | if (show_test_window) 88 | { 89 | ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiSetCond_FirstUseEver); 90 | ImGui::ShowTestWindow(&show_test_window); 91 | } 92 | 93 | // Rendering 94 | al_clear_to_color(al_map_rgba_f(clear_color.x, clear_color.y, clear_color.z, clear_color.w)); 95 | ImGui::Render(); 96 | al_flip_display(); 97 | } 98 | 99 | // Cleanup 100 | ImGui_ImplA5_Shutdown(); 101 | al_destroy_event_queue(queue); 102 | al_destroy_display(display); 103 | 104 | return 0; 105 | } 106 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/directx11_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /MD /I ..\.. /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" /D UNICODE *.cpp ..\..\*.cpp /FeDebug/directx11_example.exe /FoDebug/ /link /LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d11.lib d3dcompiler.lib 4 | 5 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/directx11_example/directx11_example.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {0587d7a3-f2ce-4d56-b84f-a0005d3bfce6} 6 | 7 | 8 | {08e36723-ce4f-4cff-9662-c40801cf1acf} 9 | 10 | 11 | 12 | 13 | imgui 14 | 15 | 16 | imgui 17 | 18 | 19 | sources 20 | 21 | 22 | imgui 23 | 24 | 25 | 26 | 27 | imgui 28 | 29 | 30 | sources 31 | 32 | 33 | sources 34 | 35 | 36 | imgui 37 | 38 | 39 | imgui 40 | 41 | 42 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/directx11_example/imgui_impl_dx11.h: -------------------------------------------------------------------------------- 1 | // ImGui Win32 + DirectX11 binding 2 | // You can copy and use unmodified imgui_impl_* files in your project. 3 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 4 | // See main.cpp for an example of using this. 5 | // https://github.com/ocornut/imgui 6 | 7 | struct ID3D11Device; 8 | struct ID3D11DeviceContext; 9 | 10 | IMGUI_API bool ImGui_ImplDX11_Init(void* hwnd, ID3D11Device* device, ID3D11DeviceContext* device_context); 11 | IMGUI_API void ImGui_ImplDX11_Shutdown(); 12 | IMGUI_API void ImGui_ImplDX11_NewFrame(); 13 | 14 | // Use if you want to reset your rendering device without losing ImGui state. 15 | IMGUI_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 16 | IMGUI_API bool ImGui_ImplDX11_CreateDeviceObjects(); 17 | 18 | // Handler for Win32 messages, update mouse/keyboard data. 19 | // You may or not need this for your implementation, but it can serve as reference for handling inputs. 20 | // Commented out to avoid dragging dependencies on types. You can copy the extern declaration in your code. 21 | /* 22 | IMGUI_API LRESULT ImGui_ImplDX11_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 23 | */ 24 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/directx9_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /MD /I ..\.. /I "%DXSDK_DIR%/Include" /D UNICODE *.cpp ..\..\*.cpp /FeDebug/directx9_example.exe /FoDebug/ /link /LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d9.lib d3dx9d.lib 4 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/directx9_example/directx9_example.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {a82cba23-9de0-45c2-b1e3-2eb1666702de} 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | sources 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | 30 | 31 | imgui 32 | 33 | 34 | imgui 35 | 36 | 37 | sources 38 | 39 | 40 | imgui 41 | 42 | 43 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/directx9_example/imgui_impl_dx9.h: -------------------------------------------------------------------------------- 1 | // ImGui Win32 + DirectX9 binding 2 | // You can copy and use unmodified imgui_impl_* files in your project. 3 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 4 | // See main.cpp for an example of using this. 5 | // https://github.com/ocornut/imgui 6 | 7 | struct IDirect3DDevice9; 8 | 9 | IMGUI_API bool ImGui_ImplDX9_Init(void* hwnd, IDirect3DDevice9* device); 10 | IMGUI_API void ImGui_ImplDX9_Shutdown(); 11 | IMGUI_API void ImGui_ImplDX9_NewFrame(); 12 | 13 | // Use if you want to reset your rendering device without losing ImGui state. 14 | IMGUI_API void ImGui_ImplDX9_InvalidateDeviceObjects(); 15 | IMGUI_API bool ImGui_ImplDX9_CreateDeviceObjects(); 16 | 17 | // Handler for Win32 messages, update mouse/keyboard data. 18 | // You may or not need this for your implementation, but it can serve as reference for handling inputs. 19 | // Commented out to avoid dragging dependencies on types. You can copy the extern declaration in your code. 20 | /* 21 | IMGUI_API LRESULT ImGui_ImplDX9_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 22 | */ 23 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/imgui_examples_msvc2010.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opengl_example", "opengl_example\opengl_example.vcxproj", "{9CDA7840-B7A5-496D-A527-E95571496D18}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "directx9_example", "directx9_example\directx9_example.vcxproj", "{4165A294-21F2-44CA-9B38-E3F935ABADF5}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "directx11_example", "directx11_example\directx11_example.vcxproj", "{9F316E83-5AE5-4939-A723-305A94F48005}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opengl3_example", "opengl3_example\opengl3_example.vcxproj", "{4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Win32 = Debug|Win32 15 | Debug|x64 = Debug|x64 16 | Release|Win32 = Release|Win32 17 | Release|x64 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {9CDA7840-B7A5-496D-A527-E95571496D18}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {9CDA7840-B7A5-496D-A527-E95571496D18}.Debug|Win32.Build.0 = Debug|Win32 22 | {9CDA7840-B7A5-496D-A527-E95571496D18}.Debug|x64.ActiveCfg = Debug|x64 23 | {9CDA7840-B7A5-496D-A527-E95571496D18}.Debug|x64.Build.0 = Debug|x64 24 | {9CDA7840-B7A5-496D-A527-E95571496D18}.Release|Win32.ActiveCfg = Release|Win32 25 | {9CDA7840-B7A5-496D-A527-E95571496D18}.Release|Win32.Build.0 = Release|Win32 26 | {9CDA7840-B7A5-496D-A527-E95571496D18}.Release|x64.ActiveCfg = Release|x64 27 | {9CDA7840-B7A5-496D-A527-E95571496D18}.Release|x64.Build.0 = Release|x64 28 | {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Debug|Win32.ActiveCfg = Debug|Win32 29 | {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Debug|Win32.Build.0 = Debug|Win32 30 | {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Debug|x64.ActiveCfg = Debug|x64 31 | {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Debug|x64.Build.0 = Debug|x64 32 | {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Release|Win32.ActiveCfg = Release|Win32 33 | {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Release|Win32.Build.0 = Release|Win32 34 | {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Release|x64.ActiveCfg = Release|x64 35 | {4165A294-21F2-44CA-9B38-E3F935ABADF5}.Release|x64.Build.0 = Release|x64 36 | {9F316E83-5AE5-4939-A723-305A94F48005}.Debug|Win32.ActiveCfg = Debug|Win32 37 | {9F316E83-5AE5-4939-A723-305A94F48005}.Debug|Win32.Build.0 = Debug|Win32 38 | {9F316E83-5AE5-4939-A723-305A94F48005}.Debug|x64.ActiveCfg = Debug|x64 39 | {9F316E83-5AE5-4939-A723-305A94F48005}.Debug|x64.Build.0 = Debug|x64 40 | {9F316E83-5AE5-4939-A723-305A94F48005}.Release|Win32.ActiveCfg = Release|Win32 41 | {9F316E83-5AE5-4939-A723-305A94F48005}.Release|Win32.Build.0 = Release|Win32 42 | {9F316E83-5AE5-4939-A723-305A94F48005}.Release|x64.ActiveCfg = Release|x64 43 | {9F316E83-5AE5-4939-A723-305A94F48005}.Release|x64.Build.0 = Release|x64 44 | {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Debug|Win32.ActiveCfg = Debug|Win32 45 | {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Debug|Win32.Build.0 = Debug|Win32 46 | {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Debug|x64.ActiveCfg = Debug|x64 47 | {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Debug|x64.Build.0 = Debug|x64 48 | {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Release|Win32.ActiveCfg = Release|Win32 49 | {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Release|Win32.Build.0 = Release|Win32 50 | {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Release|x64.ActiveCfg = Release|x64 51 | {4A1FB5EA-22F5-42A8-AB92-1D2DF5D47FB9}.Release|x64.Build.0 = Release|x64 52 | EndGlobalSection 53 | GlobalSection(SolutionProperties) = preSolution 54 | HideSolutionNode = FALSE 55 | EndGlobalSection 56 | EndGlobal 57 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | imguiex.xcodeproj/project.xcworkspace/ 3 | imguiex.xcodeproj/xcuserdata/ -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/README.md: -------------------------------------------------------------------------------- 1 | # iOS example 2 | 3 | ## Introduction 4 | 5 | This example is the default XCode "OpenGL" example code, modified to support ImGui and [Synergy](http://synergy-project.org/). 6 | 7 | It is a rather complex example because of all of the faff required to get an XCode/iOS application running. Refer to the regular OpenGL examples if you want to learn about integrating ImGui. 8 | 9 | Synergy (remote keyboard/mouse) is not required, but it's pretty hard to use ImGui without it. Synergy includes a "uSynergy" library that allows embedding a synergy client, this is what is used here. ImGui supports "TouchPadding", and this is enabled when Synergy is not active. 10 | 11 | ## How to Use 12 | 13 | 0. In Synergy, go to Preferences, and uncheck "Use SSL encryption" 14 | 0. Run the example app. 15 | 0. Tap the "servername" button in the corner 16 | 0. Enter the name or the IP of your synergy host 17 | 0. If you had previously connected to a server, you may need to kill and re-start the app. 18 | 19 | ## Notes and TODOs 20 | 21 | Things that would be nice but I didn't get around to doing: 22 | 23 | * iOS software keyboard not supported for text inputs 24 | * iOS hardware (bluetooth) keyboards not supported 25 | * Graceful disconnect/reconnect from uSynergy. 26 | * Copy/Paste not well-supported 27 | 28 | ## C++ on iOS 29 | ImGui is a c++ library. If you want to include it directly, rename your Obj-C file to have the ".mm" extension. 30 | 31 | Alternatively, you can wrap your debug code in a C interface, this is what I am demonstrating here with the "debug_hud.h" interface. Either approach works, use whatever you prefer. 32 | 33 | In my case, most of my game code is already in C++ so it's not really an issue and I can use ImGui directly. 34 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // imguiex 4 | 5 | #import 6 | 7 | @interface AppDelegate : UIResponder 8 | 9 | @property (strong, nonatomic) UIWindow *window; 10 | 11 | 12 | @end 13 | 14 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // imguiex 4 | 5 | #import "AppDelegate.h" 6 | 7 | @interface AppDelegate () 8 | 9 | @end 10 | 11 | @implementation AppDelegate 12 | 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application { 20 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 21 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 22 | } 23 | 24 | - (void)applicationDidEnterBackground:(UIApplication *)application { 25 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 26 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 27 | } 28 | 29 | - (void)applicationWillEnterForeground:(UIApplication *)application { 30 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 31 | } 32 | 33 | - (void)applicationDidBecomeActive:(UIApplication *)application { 34 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 35 | } 36 | 37 | - (void)applicationWillTerminate:(UIApplication *)application { 38 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/GameViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GameViewController.h 3 | // imguiex 4 | 5 | // This is the OpenGL Example template from XCode, modified to support ImGui 6 | 7 | #import 8 | #import 9 | 10 | @interface GameViewController : GLKViewController 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "size" : "60x60", 25 | "idiom" : "iphone", 26 | "filename" : "icon_imgui_60@2x~iphone.png", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "size" : "60x60", 31 | "idiom" : "iphone", 32 | "filename" : "icon_imgui_60@3x~iphone.png", 33 | "scale" : "3x" 34 | }, 35 | { 36 | "idiom" : "ipad", 37 | "size" : "29x29", 38 | "scale" : "1x" 39 | }, 40 | { 41 | "idiom" : "ipad", 42 | "size" : "29x29", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "idiom" : "ipad", 47 | "size" : "40x40", 48 | "scale" : "1x" 49 | }, 50 | { 51 | "idiom" : "ipad", 52 | "size" : "40x40", 53 | "scale" : "2x" 54 | }, 55 | { 56 | "size" : "76x76", 57 | "idiom" : "ipad", 58 | "filename" : "icon_imgui_76~ipad.png", 59 | "scale" : "1x" 60 | }, 61 | { 62 | "size" : "76x76", 63 | "idiom" : "ipad", 64 | "filename" : "icon_imgui_76@2x~ipad.png", 65 | "scale" : "2x" 66 | } 67 | ], 68 | "info" : { 69 | "version" : 1, 70 | "author" : "xcode" 71 | } 72 | } -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/Images.xcassets/AppIcon.appiconset/icon_imgui_60@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/cimgui/imgui/examples/ios_example/imguiex/Images.xcassets/AppIcon.appiconset/icon_imgui_60@2x~iphone.png -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/Images.xcassets/AppIcon.appiconset/icon_imgui_60@3x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/cimgui/imgui/examples/ios_example/imguiex/Images.xcassets/AppIcon.appiconset/icon_imgui_60@3x~iphone.png -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/Images.xcassets/AppIcon.appiconset/icon_imgui_76@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/cimgui/imgui/examples/ios_example/imguiex/Images.xcassets/AppIcon.appiconset/icon_imgui_76@2x~ipad.png -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/Images.xcassets/AppIcon.appiconset/icon_imgui_76~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/cimgui/imgui/examples/ios_example/imguiex/Images.xcassets/AppIcon.appiconset/icon_imgui_76~ipad.png -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.imgui.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarHidden 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/Shaders/Shader.fsh: -------------------------------------------------------------------------------- 1 | // 2 | // Shader.fsh 3 | // imguiex 4 | 5 | varying lowp vec4 colorVarying; 6 | 7 | void main() 8 | { 9 | gl_FragColor = colorVarying; 10 | } 11 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/Shaders/Shader.vsh: -------------------------------------------------------------------------------- 1 | // 2 | // Shader.vsh 3 | // imguiex 4 | 5 | attribute vec4 position; 6 | attribute vec3 normal; 7 | 8 | varying lowp vec4 colorVarying; 9 | 10 | uniform vec3 diffuseColor; 11 | uniform mat4 modelViewProjectionMatrix; 12 | uniform mat3 normalMatrix; 13 | 14 | void main() 15 | { 16 | vec3 eyeNormal = normalize(normalMatrix * normal); 17 | vec3 lightPosition = vec3(0.0, 0.0, 1.0); 18 | 19 | float nDotVP = max(0.0, dot(eyeNormal, normalize(lightPosition))); 20 | 21 | vec3 colorLit = diffuseColor * nDotVP; 22 | colorVarying = vec4( colorLit.x, colorLit.y, colorLit.z, 1.0 ); 23 | 24 | gl_Position = modelViewProjectionMatrix * position; 25 | } 26 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/debug_hud.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // debug_hud.cpp 3 | // imguiex 4 | 5 | #include 6 | 7 | #include "debug_hud.h" 8 | #include "imgui.h" 9 | 10 | void DebugHUD_InitDefaults( DebugHUD *hud ) 11 | { 12 | hud->show_test_window = true; 13 | hud->show_example_window = true; 14 | hud->rotation_speed = 15.0f; 15 | 16 | hud->cubeColor1[0] = 0.4f; 17 | hud->cubeColor1[1] = 0.4f; 18 | hud->cubeColor1[2] = 1.0f; 19 | hud->cubeColor1[3] = 1.0f; 20 | 21 | hud->cubeColor2[0] = 1.0f; 22 | hud->cubeColor2[1] = 0.4f; 23 | hud->cubeColor2[2] = 0.4f; 24 | hud->cubeColor2[3] = 1.0f; 25 | } 26 | 27 | void DebugHUD_DoInterface( DebugHUD *hud ) 28 | { 29 | if (hud->show_test_window) 30 | { 31 | ImGui::SetNextWindowPos( ImVec2( 400, 20 ), ImGuiSetCond_FirstUseEver ); 32 | ImGui::ShowTestWindow( &hud->show_test_window ); 33 | } 34 | 35 | if (hud->show_example_window) 36 | { 37 | ImGui::SetNextWindowPos( ImVec2( 20, 20 ), ImGuiSetCond_FirstUseEver ); 38 | ImGui::SetNextWindowSize( ImVec2( 350, 200 ), ImGuiSetCond_FirstUseEver ); 39 | ImGui::Begin("Another Window", &hud->show_example_window); 40 | ImGui::ColorEdit3("Cube 1 Color", hud->cubeColor1); 41 | ImGui::ColorEdit3("Cube 2 Color", hud->cubeColor2); 42 | ImGui::SliderFloat("Rotation Speed", &hud->rotation_speed, 0.0f, 200.0f); 43 | ImGui::End(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/debug_hud.h: -------------------------------------------------------------------------------- 1 | // 2 | // debug_hud.h 3 | // imguiex 4 | 5 | #pragma once 6 | 7 | typedef struct DebugHUD 8 | { 9 | bool show_test_window; 10 | bool show_example_window; 11 | float rotation_speed; 12 | float cubeColor1[4]; 13 | float cubeColor2[4]; 14 | } DebugHUD; 15 | 16 | #if __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | void DebugHUD_InitDefaults( DebugHUD *hud ); 21 | void DebugHUD_DoInterface( DebugHUD *hud ); 22 | 23 | #if __cplusplus 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/imgui_ex_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/cimgui/imgui/examples/ios_example/imguiex/imgui_ex_icon.png -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/imgui_impl_ios.h: -------------------------------------------------------------------------------- 1 | // 2 | // imgui_impl_ios.h 3 | // imguiex 4 | // 5 | // Joel Davis (joeld42@gmail.com) 6 | // 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | @interface ImGuiHelper : NSObject 14 | 15 | - (id) initWithView: (UIView *)view; 16 | 17 | - (void)connectServer: (NSString*)serverName; 18 | 19 | - (void)render; 20 | - (void)newFrame; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/ios_example/imguiex/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // imguiex 4 | // 5 | 6 | #import 7 | #import "AppDelegate.h" 8 | 9 | int main(int argc, char * argv[]) { 10 | @autoreleasepool { 11 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/libs/glfw/COPYING.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | Copyright (c) 2006-2010 Camilla Berglund 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would 15 | be appreciated but is not required. 16 | 17 | 2. Altered source versions must be plainly marked as such, and must not 18 | be misrepresented as being the original software. 19 | 20 | 3. This notice may not be removed or altered from any source 21 | distribution. 22 | 23 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/marmalade_example/data/app.icf: -------------------------------------------------------------------------------- 1 | # This file is for configuration settings for your 2 | # application. 3 | # 4 | # The syntax is similar to windows .ini files ie 5 | # 6 | # [GroupName] 7 | # Setting = Value 8 | # 9 | # Which can be read by your application using 10 | # e.g s3eConfigGetString("GroupName", "Setting", string) 11 | # 12 | # All settings must be documented in .config.txt files. 13 | # New settings specific to this application should be 14 | # documented in app.config.txt 15 | # 16 | # Some conditional operations are also permitted, see the 17 | # S3E documentation for details. 18 | 19 | [S3E] 20 | MemSize=6000000 21 | MemSizeDebug=6000000 22 | DispFixRot=FixedLandscape 23 | 24 | # emulate iphone 5 resolution, change these settings to emulate other display resolution 25 | WinWidth=1136 26 | WinHeight=640 27 | 28 | [GX] 29 | DataCacheSize=131070 30 | 31 | [Util] 32 | #MemoryBreakpoint=1282 33 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/marmalade_example/imgui_impl_marmalade.h: -------------------------------------------------------------------------------- 1 | // ImGui Marmalade binding with IwGx 2 | // Copyright (C) 2015 by Giovanni Zito 3 | // This file is part of ImGui 4 | // You can copy and use unmodified imgui_impl_* files in your project. 5 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 6 | // See main.cpp for an example of using this. 7 | // https://github.com/ocornut/imgui 8 | 9 | IMGUI_API bool ImGui_Marmalade_Init(bool install_callbacks); 10 | IMGUI_API void ImGui_Marmalade_Shutdown(); 11 | IMGUI_API void ImGui_Marmalade_NewFrame(); 12 | 13 | // Use if you want to reset your rendering device without losing ImGui state. 14 | IMGUI_API void ImGui_Marmalade_InvalidateDeviceObjects(); 15 | IMGUI_API bool ImGui_Marmalade_CreateDeviceObjects(); 16 | 17 | // callbacks (installed by default if you enable 'install_callbacks' during initialization) 18 | // You can also handle inputs yourself and use those as a reference. 19 | IMGUI_API int32 ImGui_Marmalade_PointerButtonEventCallback(void* SystemData, void* pUserData); 20 | IMGUI_API int32 ImGui_Marmalade_KeyCallback(void* SystemData, void* userData); 21 | IMGUI_API int32 ImGui_Marmalade_CharCallback(void* SystemData, void* userData); 22 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/marmalade_example/main.cpp: -------------------------------------------------------------------------------- 1 | // ImGui - standalone example application for Marmalade 2 | // Copyright (C) 2015 by Giovanni Zito 3 | // This file is part of ImGui 4 | // https://github.com/ocornut/imgui 5 | 6 | #include 7 | #include "imgui_impl_marmalade.h" 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | int main(int, char**) 15 | { 16 | // Setup ImGui binding 17 | ImGui_Marmalade_Init(true); 18 | 19 | // Load Fonts 20 | // (see extra_fonts/README.txt for more details) 21 | //ImGuiIO& io = ImGui::GetIO(); 22 | //io.Fonts->AddFontDefault(); 23 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/Cousine-Regular.ttf", 15.0f); 24 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f); 25 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f); 26 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f); 27 | //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese()); 28 | 29 | // Merge glyphs from multiple fonts into one (e.g. combine default font with another with Chinese glyphs, or add icons) 30 | //ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 }; 31 | //ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true; 32 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 18.0f); 33 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/fontawesome-webfont.ttf", 18.0f, &icons_config, icons_ranges); 34 | 35 | bool show_test_window = true; 36 | bool show_another_window = false; 37 | ImVec4 clear_color = ImColor(114, 144, 154); 38 | 39 | // Main loop 40 | while (true) 41 | { 42 | if (s3eDeviceCheckQuitRequest()) 43 | break; 44 | 45 | s3eKeyboardUpdate(); 46 | s3ePointerUpdate(); 47 | ImGui_Marmalade_NewFrame(); 48 | 49 | // 1. Show a simple window 50 | // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug" 51 | { 52 | static float f = 0.0f; 53 | ImGui::Text("Hello, world!"); 54 | ImGui::SliderFloat("float", &f, 0.0f, 1.0f); 55 | ImGui::ColorEdit3("clear color", (float*)&clear_color); 56 | if (ImGui::Button("Test Window")) show_test_window ^= 1; 57 | if (ImGui::Button("Another Window")) show_another_window ^= 1; 58 | ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate); 59 | } 60 | 61 | // 2. Show another simple window, this time using an explicit Begin/End pair 62 | if (show_another_window) 63 | { 64 | ImGui::SetNextWindowSize(ImVec2(200,100), ImGuiSetCond_FirstUseEver); 65 | ImGui::Begin("Another Window", &show_another_window); 66 | ImGui::Text("Hello"); 67 | ImGui::End(); 68 | } 69 | 70 | // 3. Show the ImGui test window. Most of the sample code is in ImGui::ShowTestWindow() 71 | if (show_test_window) 72 | { 73 | ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiSetCond_FirstUseEver); 74 | ImGui::ShowTestWindow(&show_test_window); 75 | } 76 | 77 | // Rendering 78 | IwGxSetColClear(clear_color.x*255,clear_color.y*255,clear_color.z*255,clear_color.w*255) ; 79 | IwGxClear(); 80 | ImGui::Render(); 81 | IwGxSwapBuffers(); 82 | 83 | s3eDeviceYield(0); 84 | } 85 | 86 | // Cleanup 87 | ImGui_Marmalade_Shutdown(); 88 | 89 | return 0; 90 | } 91 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/marmalade_example/marmalade_example.mkb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env mkb 2 | 3 | # ImGui - standalone example application for Marmalade 4 | # Copyright (C) 2015 by Giovanni Zito 5 | # This file is part of ImGui 6 | # https://github.com/ocornut/imgui 7 | 8 | define IMGUI_DISABLE_INCLUDE_IMCONFIG_H 9 | define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS 10 | define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS 11 | define _snprintf=snprintf 12 | 13 | options 14 | { 15 | optimise-speed=1 16 | } 17 | 18 | includepaths 19 | { 20 | ../.. 21 | } 22 | 23 | subprojects 24 | { 25 | iwgx 26 | } 27 | 28 | files 29 | { 30 | (.) 31 | ["imgui"] 32 | ../../imgui.cpp 33 | ../../imgui_demo.cpp 34 | ../../imgui_draw.cpp 35 | ../../imconfig.h 36 | ../../imgui.h 37 | ../../imgui_internal.h 38 | 39 | ["imgui","Marmalade binding"] 40 | imgui_impl_marmalade.h 41 | imgui_impl_marmalade.cpp 42 | main.cpp 43 | 44 | } 45 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/opengl3_example/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # 6 | # if you using Mac OS X: 7 | # You'll need glfw 8 | # http://www.glfw.org 9 | # 10 | 11 | #CXX = g++ 12 | 13 | EXE = opengl3_example 14 | OBJS = main.o imgui_impl_glfw_gl3.o 15 | OBJS += ../../imgui.o ../../imgui_demo.o ../../imgui_draw.o 16 | OBJS += ../libs/gl3w/GL/gl3w.o 17 | 18 | UNAME_S := $(shell uname -s) 19 | 20 | 21 | ifeq ($(UNAME_S), Linux) #LINUX 22 | ECHO_MESSAGE = "Linux" 23 | LIBS = `pkg-config --static --libs glfw3` 24 | 25 | CXXFLAGS = -I../../ -I../libs/gl3w `pkg-config --cflags glfw3` 26 | CXXFLAGS += -Wall -Wformat 27 | CFLAGS = $(CXXFLAGS) 28 | endif 29 | 30 | ifeq ($(UNAME_S), Darwin) #APPLE 31 | ECHO_MESSAGE = "Mac OS X" 32 | LIBS = -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo 33 | LIBS += -L/usr/local/lib 34 | LIBS += -lglfw3 35 | 36 | CXXFLAGS = -I../../ -I../libs/gl3w -I/usr/local/Cellar/glew/1.10.0/include -I/usr/local/include 37 | CXXFLAGS += -Wall -Wformat 38 | # CXXFLAGS += -D__APPLE__ 39 | CFLAGS = $(CXXFLAGS) 40 | endif 41 | 42 | ifeq ($(UNAME_S), MINGW64_NT-6.3) 43 | ECHO_MESSAGE = "Windows" 44 | LIBS = -lglfw3 -lgdi32 -lopengl32 -limm32 45 | 46 | CXXFLAGS = -I../../ -I../libs/gl3w `pkg-config --cflags glfw3` 47 | CXXFLAGS += -Wall -Wformat 48 | CFLAGS = $(CXXFLAGS) 49 | endif 50 | 51 | 52 | .cpp.o: 53 | $(CXX) $(CXXFLAGS) -c -o $@ $< 54 | 55 | all: $(EXE) 56 | @echo Build complete for $(ECHO_MESSAGE) 57 | 58 | $(EXE): $(OBJS) 59 | $(CXX) -o $(EXE) $(OBJS) $(CXXFLAGS) $(LIBS) 60 | 61 | clean: 62 | rm $(EXE) $(OBJS) 63 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/opengl3_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /MD /I ..\.. -I ..\libs\glfw\include -I ..\libs\gl3w *.cpp ..\..\*.cpp ..\libs\gl3w\GL\gl3w.c /FeDebug/opengl_example3.exe /FoDebug/ /link /LIBPATH:..\libs\glfw\lib-vc2010-32 glfw3.lib opengl32.lib gdi32.lib shell32.lib 4 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/opengl3_example/imgui_impl_glfw_gl3.h: -------------------------------------------------------------------------------- 1 | // ImGui GLFW binding with OpenGL3 + shaders 2 | // You can copy and use unmodified imgui_impl_* files in your project. 3 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 4 | // See main.cpp for an example of using this. 5 | // https://github.com/ocornut/imgui 6 | 7 | struct GLFWwindow; 8 | 9 | IMGUI_API bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks); 10 | IMGUI_API void ImGui_ImplGlfwGL3_Shutdown(); 11 | IMGUI_API void ImGui_ImplGlfwGL3_NewFrame(); 12 | 13 | // Use if you want to reset your rendering device without losing ImGui state. 14 | IMGUI_API void ImGui_ImplGlfwGL3_InvalidateDeviceObjects(); 15 | IMGUI_API bool ImGui_ImplGlfwGL3_CreateDeviceObjects(); 16 | 17 | // GLFW callbacks (installed by default if you enable 'install_callbacks' during initialization) 18 | // Provided here if you want to chain callbacks. 19 | // You can also handle inputs yourself and use those as a reference. 20 | IMGUI_API void ImGui_ImplGlfwGL3_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods); 21 | IMGUI_API void ImGui_ImplGlfwGL3_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset); 22 | IMGUI_API void ImGui_ImplGlfwGL3_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods); 23 | IMGUI_API void ImGui_ImplGlfwGL3_CharCallback(GLFWwindow* window, unsigned int c); 24 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/opengl3_example/main.cpp: -------------------------------------------------------------------------------- 1 | // ImGui - standalone example application for Glfw + OpenGL 3, using programmable pipeline 2 | 3 | #include 4 | #include "imgui_impl_glfw_gl3.h" 5 | #include 6 | #include 7 | #include 8 | 9 | static void error_callback(int error, const char* description) 10 | { 11 | fprintf(stderr, "Error %d: %s\n", error, description); 12 | } 13 | 14 | int main(int, char**) 15 | { 16 | // Setup window 17 | glfwSetErrorCallback(error_callback); 18 | if (!glfwInit()) 19 | exit(1); 20 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); 21 | glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); 22 | glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); 23 | #if __APPLE__ 24 | glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); 25 | #endif 26 | GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui OpenGL3 example", NULL, NULL); 27 | glfwMakeContextCurrent(window); 28 | gl3wInit(); 29 | 30 | // Setup ImGui binding 31 | ImGui_ImplGlfwGL3_Init(window, true); 32 | 33 | // Load Fonts 34 | // (see extra_fonts/README.txt for more details) 35 | //ImGuiIO& io = ImGui::GetIO(); 36 | //io.Fonts->AddFontDefault(); 37 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/Cousine-Regular.ttf", 15.0f); 38 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f); 39 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f); 40 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f); 41 | //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese()); 42 | 43 | // Merge glyphs from multiple fonts into one (e.g. combine default font with another with Chinese glyphs, or add icons) 44 | //ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 }; 45 | //ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true; 46 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 18.0f); 47 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/fontawesome-webfont.ttf", 18.0f, &icons_config, icons_ranges); 48 | 49 | bool show_test_window = true; 50 | bool show_another_window = false; 51 | ImVec4 clear_color = ImColor(114, 144, 154); 52 | 53 | // Main loop 54 | while (!glfwWindowShouldClose(window)) 55 | { 56 | glfwPollEvents(); 57 | ImGui_ImplGlfwGL3_NewFrame(); 58 | 59 | // 1. Show a simple window 60 | // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug" 61 | { 62 | static float f = 0.0f; 63 | ImGui::Text("Hello, world!"); 64 | ImGui::SliderFloat("float", &f, 0.0f, 1.0f); 65 | ImGui::ColorEdit3("clear color", (float*)&clear_color); 66 | if (ImGui::Button("Test Window")) show_test_window ^= 1; 67 | if (ImGui::Button("Another Window")) show_another_window ^= 1; 68 | ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate); 69 | } 70 | 71 | // 2. Show another simple window, this time using an explicit Begin/End pair 72 | if (show_another_window) 73 | { 74 | ImGui::SetNextWindowSize(ImVec2(200,100), ImGuiSetCond_FirstUseEver); 75 | ImGui::Begin("Another Window", &show_another_window); 76 | ImGui::Text("Hello"); 77 | ImGui::End(); 78 | } 79 | 80 | // 3. Show the ImGui test window. Most of the sample code is in ImGui::ShowTestWindow() 81 | if (show_test_window) 82 | { 83 | ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiSetCond_FirstUseEver); 84 | ImGui::ShowTestWindow(&show_test_window); 85 | } 86 | 87 | // Rendering 88 | int display_w, display_h; 89 | glfwGetFramebufferSize(window, &display_w, &display_h); 90 | glViewport(0, 0, display_w, display_h); 91 | glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w); 92 | glClear(GL_COLOR_BUFFER_BIT); 93 | ImGui::Render(); 94 | glfwSwapBuffers(window); 95 | } 96 | 97 | // Cleanup 98 | ImGui_ImplGlfwGL3_Shutdown(); 99 | glfwTerminate(); 100 | 101 | return 0; 102 | } 103 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/opengl3_example/opengl3_example.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | {42f99867-3108-43b8-99d0-fabefaf1f2e3} 13 | 14 | 15 | 16 | 17 | sources 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | gl3w 27 | 28 | 29 | imgui 30 | 31 | 32 | imgui 33 | 34 | 35 | 36 | 37 | imgui 38 | 39 | 40 | imgui 41 | 42 | 43 | sources 44 | 45 | 46 | gl3w 47 | 48 | 49 | gl3w 50 | 51 | 52 | imgui 53 | 54 | 55 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/opengl_example/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # 6 | # if you using Mac OS X: 7 | # You'll need glfw 8 | # http://www.glfw.org 9 | # 10 | 11 | #CXX = g++ 12 | 13 | EXE = opengl_example 14 | OBJS = main.o imgui_impl_glfw.o 15 | OBJS += ../../imgui.o ../../imgui_demo.o ../../imgui_draw.o 16 | 17 | UNAME_S := $(shell uname -s) 18 | 19 | 20 | ifeq ($(UNAME_S), Linux) #LINUX 21 | ECHO_MESSAGE = "Linux" 22 | LIBS = `pkg-config --static --libs glfw3` 23 | 24 | CXXFLAGS = -I../../ `pkg-config --cflags glfw3` 25 | CXXFLAGS += -Wall -Wformat 26 | CFLAGS = $(CXXFLAGS) 27 | endif 28 | 29 | ifeq ($(UNAME_S), Darwin) #APPLE 30 | ECHO_MESSAGE = "Mac OS X" 31 | LIBS = -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo 32 | LIBS += -L/usr/local/lib 33 | LIBS += -lglfw3 34 | 35 | CXXFLAGS = -I../../ -I/usr/local/include 36 | CXXFLAGS += -Wall -Wformat 37 | # CXXFLAGS += -D__APPLE__ 38 | CFLAGS = $(CXXFLAGS) 39 | endif 40 | 41 | ifeq ($(UNAME_S), MINGW64_NT-6.3) 42 | ECHO_MESSAGE = "Windows" 43 | LIBS = -lglfw3 -lgdi32 -lopengl32 -limm32 44 | 45 | CXXFLAGS = -I../../ -I../libs/gl3w `pkg-config --cflags glfw3` 46 | CXXFLAGS += -Wall -Wformat 47 | CFLAGS = $(CXXFLAGS) 48 | endif 49 | 50 | .cpp.o: 51 | $(CXX) $(CXXFLAGS) -c -o $@ $< 52 | 53 | all: $(EXE) 54 | @echo Build complete for $(ECHO_MESSAGE) 55 | 56 | $(EXE): $(OBJS) 57 | $(CXX) -o $(EXE) $(OBJS) $(CXXFLAGS) $(LIBS) 58 | 59 | clean: 60 | rm $(EXE) $(OBJS) 61 | 62 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/opengl_example/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /MD /I ..\.. -I ..\libs\glfw\include *.cpp ..\..\*.cpp /FeDebug/opengl_example.exe /FoDebug/ /link /LIBPATH:..\libs\glfw\lib-vc2010-32 glfw3.lib opengl32.lib gdi32.lib shell32.lib 4 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/opengl_example/imgui_impl_glfw.h: -------------------------------------------------------------------------------- 1 | // ImGui GLFW binding with OpenGL 2 | // You can copy and use unmodified imgui_impl_* files in your project. 3 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 4 | // See main.cpp for an example of using this. 5 | // https://github.com/ocornut/imgui 6 | 7 | struct GLFWwindow; 8 | 9 | IMGUI_API bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks); 10 | IMGUI_API void ImGui_ImplGlfw_Shutdown(); 11 | IMGUI_API void ImGui_ImplGlfw_NewFrame(); 12 | 13 | // Use if you want to reset your rendering device without losing ImGui state. 14 | IMGUI_API void ImGui_ImplGlfw_InvalidateDeviceObjects(); 15 | IMGUI_API bool ImGui_ImplGlfw_CreateDeviceObjects(); 16 | 17 | // GLFW callbacks (installed by default if you enable 'install_callbacks' during initialization) 18 | // Provided here if you want to chain callbacks. 19 | // You can also handle inputs yourself and use those as a reference. 20 | IMGUI_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods); 21 | IMGUI_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset); 22 | IMGUI_API void ImGui_ImplGlFw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods); 23 | IMGUI_API void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c); 24 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/opengl_example/main.cpp: -------------------------------------------------------------------------------- 1 | // ImGui - standalone example application for Glfw + OpenGL 2, using fixed pipeline 2 | 3 | #include 4 | #include "imgui_impl_glfw.h" 5 | #include 6 | #include 7 | 8 | static void error_callback(int error, const char* description) 9 | { 10 | fprintf(stderr, "Error %d: %s\n", error, description); 11 | } 12 | 13 | int main(int, char**) 14 | { 15 | // Setup window 16 | glfwSetErrorCallback(error_callback); 17 | if (!glfwInit()) 18 | exit(1); 19 | GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui OpenGL2 example", NULL, NULL); 20 | glfwMakeContextCurrent(window); 21 | 22 | // Setup ImGui binding 23 | ImGui_ImplGlfw_Init(window, true); 24 | 25 | // Load Fonts 26 | // (see extra_fonts/README.txt for more details) 27 | //ImGuiIO& io = ImGui::GetIO(); 28 | //io.Fonts->AddFontDefault(); 29 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/Cousine-Regular.ttf", 15.0f); 30 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f); 31 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f); 32 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f); 33 | //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese()); 34 | 35 | // Merge glyphs from multiple fonts into one (e.g. combine default font with another with Chinese glyphs, or add icons) 36 | //ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 }; 37 | //ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true; 38 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 18.0f); 39 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/fontawesome-webfont.ttf", 18.0f, &icons_config, icons_ranges); 40 | 41 | bool show_test_window = true; 42 | bool show_another_window = false; 43 | ImVec4 clear_color = ImColor(114, 144, 154); 44 | 45 | // Main loop 46 | while (!glfwWindowShouldClose(window)) 47 | { 48 | glfwPollEvents(); 49 | ImGui_ImplGlfw_NewFrame(); 50 | 51 | // 1. Show a simple window 52 | // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug" 53 | { 54 | static float f = 0.0f; 55 | ImGui::Text("Hello, world!"); 56 | ImGui::SliderFloat("float", &f, 0.0f, 1.0f); 57 | ImGui::ColorEdit3("clear color", (float*)&clear_color); 58 | if (ImGui::Button("Test Window")) show_test_window ^= 1; 59 | if (ImGui::Button("Another Window")) show_another_window ^= 1; 60 | ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate); 61 | } 62 | 63 | // 2. Show another simple window, this time using an explicit Begin/End pair 64 | if (show_another_window) 65 | { 66 | ImGui::SetNextWindowSize(ImVec2(200,100), ImGuiSetCond_FirstUseEver); 67 | ImGui::Begin("Another Window", &show_another_window); 68 | ImGui::Text("Hello"); 69 | ImGui::End(); 70 | } 71 | 72 | // 3. Show the ImGui test window. Most of the sample code is in ImGui::ShowTestWindow() 73 | if (show_test_window) 74 | { 75 | ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiSetCond_FirstUseEver); 76 | ImGui::ShowTestWindow(&show_test_window); 77 | } 78 | 79 | // Rendering 80 | int display_w, display_h; 81 | glfwGetFramebufferSize(window, &display_w, &display_h); 82 | glViewport(0, 0, display_w, display_h); 83 | glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w); 84 | glClear(GL_COLOR_BUFFER_BIT); 85 | ImGui::Render(); 86 | glfwSwapBuffers(window); 87 | } 88 | 89 | // Cleanup 90 | ImGui_ImplGlfw_Shutdown(); 91 | glfwTerminate(); 92 | 93 | return 0; 94 | } 95 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/opengl_example/opengl_example.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {c336cfe3-f0c4-464c-9ef0-a9e17a7ff222} 6 | 7 | 8 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | sources 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | 30 | 31 | imgui 32 | 33 | 34 | imgui 35 | 36 | 37 | sources 38 | 39 | 40 | imgui 41 | 42 | 43 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/sdl_opengl_example/README.md: -------------------------------------------------------------------------------- 1 | 2 | # How to Build 3 | 4 | - On Windows with Visual Studio's CLI 5 | 6 | \ is your SDL2 folder. 7 | 8 | ``` 9 | cl /MD /I /I ..\.. main.cpp imgui_impl_sdl.cpp ..\..\imgui*.cpp /link /LIBPATH: SDL2.lib SDL2main.lib 10 | ``` 11 | 12 | - On Linux and similar Unixes 13 | 14 | ``` 15 | c++ `sdl2-config --cflags` -I ../.. main.cpp imgui_impl_sdl.cpp ../../imgui*.cpp `sdl2-config --libs` -lGL -o sdl2example 16 | ``` 17 | 18 | - On Mac OS X 19 | 20 | ``` 21 | brew install sdl2 22 | c++ `sdl2-config --cflags` -I ../.. main.cpp imgui_impl_sdl.cpp ../../imgui*.cpp `sdl2-config --libs` -framework OpenGl -o sdl2example 23 | ``` 24 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/sdl_opengl_example/imgui_impl_sdl.h: -------------------------------------------------------------------------------- 1 | // ImGui SDL2 binding with OpenGL 2 | // You can copy and use unmodified imgui_impl_* files in your project. 3 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 4 | // See main.cpp for an example of using this. 5 | // https://github.com/ocornut/imgui 6 | 7 | struct SDL_Window; 8 | typedef union SDL_Event SDL_Event; 9 | 10 | IMGUI_API bool ImGui_ImplSdl_Init(SDL_Window *window); 11 | IMGUI_API void ImGui_ImplSdl_Shutdown(); 12 | IMGUI_API void ImGui_ImplSdl_NewFrame(SDL_Window *window); 13 | IMGUI_API bool ImGui_ImplSdl_ProcessEvent(SDL_Event* event); 14 | 15 | // Use if you want to reset your rendering device without losing ImGui state. 16 | IMGUI_API void ImGui_ImplSdl_InvalidateDeviceObjects(); 17 | IMGUI_API bool ImGui_ImplSdl_CreateDeviceObjects(); 18 | -------------------------------------------------------------------------------- /external/cimgui/imgui/examples/sdl_opengl_example/main.cpp: -------------------------------------------------------------------------------- 1 | // ImGui - standalone example application for SDL2 + OpenGL 2 | 3 | #include 4 | #include "imgui_impl_sdl.h" 5 | #include 6 | #include 7 | #include 8 | 9 | int main(int, char**) 10 | { 11 | // Setup SDL 12 | if (SDL_Init(SDL_INIT_EVERYTHING) != 0) 13 | { 14 | printf("Error: %s\n", SDL_GetError()); 15 | return -1; 16 | } 17 | 18 | // Setup window 19 | SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); 20 | SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); 21 | SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); 22 | SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); 23 | SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); 24 | SDL_DisplayMode current; 25 | SDL_GetCurrentDisplayMode(0, ¤t); 26 | SDL_Window *window = SDL_CreateWindow("ImGui SDL2+OpenGL example", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, SDL_WINDOW_OPENGL|SDL_WINDOW_RESIZABLE); 27 | SDL_GLContext glcontext = SDL_GL_CreateContext(window); 28 | 29 | // Setup ImGui binding 30 | ImGui_ImplSdl_Init(window); 31 | 32 | // Load Fonts 33 | // (see extra_fonts/README.txt for more details) 34 | //ImGuiIO& io = ImGui::GetIO(); 35 | //io.Fonts->AddFontDefault(); 36 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/Cousine-Regular.ttf", 15.0f); 37 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f); 38 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f); 39 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f); 40 | //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese()); 41 | 42 | // Merge glyphs from multiple fonts into one (e.g. combine default font with another with Chinese glyphs, or add icons) 43 | //ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 }; 44 | //ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true; 45 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 18.0f); 46 | //io.Fonts->AddFontFromFileTTF("../../extra_fonts/fontawesome-webfont.ttf", 18.0f, &icons_config, icons_ranges); 47 | 48 | bool show_test_window = true; 49 | bool show_another_window = false; 50 | ImVec4 clear_color = ImColor(114, 144, 154); 51 | 52 | // Main loop 53 | bool done = false; 54 | while (!done) 55 | { 56 | SDL_Event event; 57 | while (SDL_PollEvent(&event)) 58 | { 59 | ImGui_ImplSdl_ProcessEvent(&event); 60 | if (event.type == SDL_QUIT) 61 | done = true; 62 | } 63 | ImGui_ImplSdl_NewFrame(window); 64 | 65 | // 1. Show a simple window 66 | // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug" 67 | { 68 | static float f = 0.0f; 69 | ImGui::Text("Hello, world!"); 70 | ImGui::SliderFloat("float", &f, 0.0f, 1.0f); 71 | ImGui::ColorEdit3("clear color", (float*)&clear_color); 72 | if (ImGui::Button("Test Window")) show_test_window ^= 1; 73 | if (ImGui::Button("Another Window")) show_another_window ^= 1; 74 | ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate); 75 | } 76 | 77 | // 2. Show another simple window, this time using an explicit Begin/End pair 78 | if (show_another_window) 79 | { 80 | ImGui::SetNextWindowSize(ImVec2(200,100), ImGuiSetCond_FirstUseEver); 81 | ImGui::Begin("Another Window", &show_another_window); 82 | ImGui::Text("Hello"); 83 | ImGui::End(); 84 | } 85 | 86 | // 3. Show the ImGui test window. Most of the sample code is in ImGui::ShowTestWindow() 87 | if (show_test_window) 88 | { 89 | ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiSetCond_FirstUseEver); 90 | ImGui::ShowTestWindow(&show_test_window); 91 | } 92 | 93 | // Rendering 94 | glViewport(0, 0, (int)ImGui::GetIO().DisplaySize.x, (int)ImGui::GetIO().DisplaySize.y); 95 | glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w); 96 | glClear(GL_COLOR_BUFFER_BIT); 97 | ImGui::Render(); 98 | SDL_GL_SwapWindow(window); 99 | } 100 | 101 | // Cleanup 102 | ImGui_ImplSdl_Shutdown(); 103 | SDL_GL_DeleteContext(glcontext); 104 | SDL_DestroyWindow(window); 105 | SDL_Quit(); 106 | 107 | return 0; 108 | } 109 | -------------------------------------------------------------------------------- /external/cimgui/imgui/extra_fonts/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/cimgui/imgui/extra_fonts/Cousine-Regular.ttf -------------------------------------------------------------------------------- /external/cimgui/imgui/extra_fonts/DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/cimgui/imgui/extra_fonts/DroidSans.ttf -------------------------------------------------------------------------------- /external/cimgui/imgui/extra_fonts/Karla-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/cimgui/imgui/extra_fonts/Karla-Regular.ttf -------------------------------------------------------------------------------- /external/cimgui/imgui/extra_fonts/ProggyClean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/cimgui/imgui/extra_fonts/ProggyClean.ttf -------------------------------------------------------------------------------- /external/cimgui/imgui/extra_fonts/ProggyTiny.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/cimgui/imgui/extra_fonts/ProggyTiny.ttf -------------------------------------------------------------------------------- /external/cimgui/imgui/extra_fonts/README.txt: -------------------------------------------------------------------------------- 1 | 2 | The code in imgui.cpp embeds a copy of 'ProggyClean.ttf' that you can use without any external files. 3 | Those are only provided as a convenience, you can load your own .TTF files. 4 | 5 | --------------------------------- 6 | LOADING INSTRUCTIONS 7 | --------------------------------- 8 | 9 | Load default font with: 10 | 11 | ImGuiIO& io = ImGui::GetIO(); 12 | io.Fonts->AddFontDefault(); 13 | 14 | Load .TTF file with: 15 | 16 | ImGuiIO& io = ImGui::GetIO(); 17 | io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels); 18 | 19 | Detailed options: 20 | 21 | ImFontConfig config; 22 | config.OversampleH = 3; 23 | config.OversampleV = 3; 24 | config.GlyphExtraSpacing.x = 1.0f; 25 | io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, &config); 26 | 27 | Combine two fonts into one: 28 | 29 | // Load main font 30 | io.Fonts->AddFontDefault(); 31 | 32 | // Add character ranges and merge into main font 33 | ImWchar ranges[] = { 0xf000, 0xf3ff, 0 }; 34 | ImFontConfig config; 35 | config.MergeMode = true; 36 | io.Fonts->AddFontFromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges); 37 | io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, &config, io.Fonts->GetGlyphRangesJapanese()); 38 | 39 | Add a fourth parameter to bake specific font ranges only: 40 | 41 | // Basic Latin, Extended Latin 42 | io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesDefault()); 43 | 44 | // Include full set of about 21000 CJK Unified Ideographs 45 | io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesJapanese()); 46 | 47 | // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs 48 | io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesChinese()); 49 | 50 | Offset font vertically by altering the io.Font->DisplayOffset value: 51 | 52 | ImFont* font = io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels); 53 | font->DisplayOffset.y += 1; // Render 1 pixel down 54 | 55 | --------------------------------- 56 | EMBED A FONT IN SOURCE CODE 57 | --------------------------------- 58 | 59 | Compile and use 'binary_to_compressed_c.cpp' to create a compressed C style array. Then load the font with: 60 | 61 | ImFont* font = io.Fonts->AddFontFromMemoryCompressedTTF(compressed_data, compressed_data_size, size_pixels, ...); 62 | 63 | Or 64 | 65 | ImFont* font = io.Fonts->AddFontFromMemoryCompressedBase85TTF(compressed_data_base85, size_pixels, ...); 66 | 67 | --------------------------------- 68 | INCLUDED FONT FILES 69 | --------------------------------- 70 | 71 | Cousine-Regular.ttf 72 | Digitized data copyright (c) 2010 Google Corporation. 73 | Licensed under the SIL Open Font License, Version 1.1 74 | 75 | DroidSans.ttf 76 | Copyright (c) Steve Matteson 77 | Apache License, version 2.0 78 | http://www.google.com/fonts/specimen/Droid+Sans 79 | 80 | ProggyClean.ttf 81 | Copyright (c) 2004, 2005 Tristan Grimmer 82 | MIT License 83 | recommended loading setting in ImGui: Size = 13.0, DisplayOffset.Y = +1 84 | 85 | ProggyTiny.ttf 86 | Copyright (c) 2004, 2005 Tristan Grimmer 87 | MIT License 88 | recommended loading setting in ImGui: Size = 10.0, DisplayOffset.Y = +1 89 | 90 | Karla-Regular 91 | Copyright (c) 2012, Jonathan Pinhorn 92 | SIL OPEN FONT LICENSE Version 1.1 93 | 94 | --------------------------------- 95 | LINKS 96 | --------------------------------- 97 | 98 | Typefaces for source code beautification 99 | https://github.com/chrissimpkins/codeface 100 | 101 | Programmation fonts 102 | http://s9w.github.io/font_compare/ 103 | 104 | Proggy Programming Fonts 105 | http://upperbounds.net 106 | 107 | Inconsolata 108 | http://www.levien.com/type/myfonts/inconsolata.html 109 | 110 | Adobe Source Code Pro: Monospaced font family for user interface and coding environments 111 | https://github.com/adobe-fonts/source-code-pro 112 | 113 | Monospace/Fixed Width Programmer's Fonts 114 | http://www.lowing.org/fonts/ 115 | 116 | (Japanese) M+ fonts by Coji Morishita are free and include most useful Kanjis you would need. 117 | http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/index-en.html 118 | 119 | Or use Arial Unicode or other Unicode fonts provided with Windows for full characters coverage (not sure of their licensing). 120 | -------------------------------------------------------------------------------- /external/cimgui/imgui/imconfig.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // USER IMPLEMENTATION 3 | // This file contains compile-time options for ImGui. 4 | // Other options (memory allocation overrides, callbacks, etc.) can be set at runtime via the ImGuiIO structure - ImGui::GetIO(). 5 | //----------------------------------------------------------------------------- 6 | 7 | #pragma once 8 | 9 | //---- Define assertion handler. Defaults to calling assert(). 10 | //#define IM_ASSERT(_EXPR) MyAssert(_EXPR) 11 | 12 | //---- Define attributes of all API symbols declarations, e.g. for DLL under Windows. 13 | //#define IMGUI_API __declspec( dllexport ) 14 | //#define IMGUI_API __declspec( dllimport ) 15 | 16 | //---- Include imgui_user.inl at the end of imgui.cpp so you can include code that extends ImGui using its private data/functions. 17 | //#define IMGUI_INCLUDE_IMGUI_USER_INL 18 | 19 | //---- Include imgui_user.h at the end of imgui.h 20 | //#define IMGUI_INCLUDE_IMGUI_USER_H 21 | 22 | //---- Don't implement default handlers for Windows (so as not to link with OpenClipboard() and others Win32 functions) 23 | //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS 24 | //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS 25 | 26 | //---- Don't implement help and test window functionality (ShowUserGuide()/ShowStyleEditor()/ShowTestWindow() methods will be empty) 27 | //#define IMGUI_DISABLE_TEST_WINDOWS 28 | 29 | //---- Don't define obsolete functions names 30 | //#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS 31 | 32 | //---- Implement STB libraries in a namespace to avoid conflicts 33 | //#define IMGUI_STB_NAMESPACE ImGuiStb 34 | 35 | //---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4. 36 | /* 37 | #define IM_VEC2_CLASS_EXTRA \ 38 | ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \ 39 | operator MyVec2() const { return MyVec2(x,y); } 40 | 41 | #define IM_VEC4_CLASS_EXTRA \ 42 | ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \ 43 | operator MyVec4() const { return MyVec4(x,y,z,w); } 44 | */ 45 | 46 | //---- Freely implement extra functions within the ImGui:: namespace. 47 | //---- Declare helpers or widgets implemented in imgui_user.inl or elsewhere, so end-user doesn't need to include multiple files. 48 | //---- e.g. you can create variants of the ImGui::Value() helper for your low-level math types, or your own widgets/helpers. 49 | /* 50 | namespace ImGui 51 | { 52 | void Value(const char* prefix, const MyVec2& v, const char* float_format = NULL); 53 | void Value(const char* prefix, const MyVec4& v, const char* float_format = NULL); 54 | } 55 | */ 56 | 57 | -------------------------------------------------------------------------------- /external/cimgui/menus-api.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kseitz/selos/573ff81efa7de7a548ea7280cf667fbde689a751/external/cimgui/menus-api.gif -------------------------------------------------------------------------------- /src/extensionBuilder.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | local M = {} 31 | 32 | function M.newExtensionBuilder(name) 33 | local ext = { 34 | name = name, 35 | MemberTypes = {}, 36 | } 37 | 38 | setmetatable(ext, { 39 | __index = function(t,k) 40 | return t.MemberTypes[k] 41 | end, 42 | }) 43 | 44 | function ext:registerMemberType(typename) 45 | ext.MemberTypes[typename] = {} 46 | end 47 | 48 | function ext:finishBuild() 49 | local ret = { 50 | name = self.name, 51 | memberMetatables = {} 52 | } 53 | 54 | for k, v in pairs(self.MemberTypes) do 55 | ret.memberMetatables[k] = { 56 | __indexTable = v, 57 | __index = function(table, key) 58 | local indexTable = getmetatable(table).__indexTable 59 | return indexTable[key] 60 | end, 61 | } 62 | end 63 | 64 | for k, v in pairs(self) do 65 | if type(v) == "function" then 66 | if not (k == "RegiseterMemberType" or k == "finishBuild") then 67 | ret[k] = v 68 | end 69 | end 70 | end 71 | 72 | return ret 73 | end 74 | 75 | return ext 76 | end 77 | 78 | return M 79 | -------------------------------------------------------------------------------- /src/gfx-utils.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | -- gfx-utils.t 31 | 32 | local Gfx = require "gfx" 33 | 34 | function Gfx.UniformBuffer(T, sym, setupCode) 35 | pcall(function() 36 | T = T:astype() 37 | end) 38 | 39 | local size = terralib.sizeof(T); 40 | 41 | local struct UB 42 | { 43 | raw : Gfx.Buffer; 44 | } 45 | 46 | terra UB:init( device : &Gfx.Device ) 47 | self.raw = device:beginBuildBuffer() 48 | :setSize(size) 49 | :setUsage(Gfx.Usage.Dynamic) 50 | :setBindUniformBuffer() 51 | :setCPUAccess(Gfx.CPUAccess.Write) 52 | :endBuild(); 53 | end 54 | 55 | terra UB:getRaw() 56 | return self.raw 57 | end 58 | 59 | terra UB:setRaw(r : Gfx.Buffer) 60 | self.raw = r 61 | end 62 | 63 | terra UB.methods.make( device : &Gfx.Device ) 64 | var u : UB; 65 | u:init(device) 66 | return u; 67 | end 68 | 69 | terra UB:map( context : &Gfx.Context, mode : Gfx.MapModeT ) : &T 70 | var ptr = context:mapBuffer(self.raw, mode, size, Gfx.Usage.Dynamic); 71 | return [&T](ptr); 72 | end 73 | 74 | terra UB:unmap( context : &Gfx.Context ) 75 | context:unmapBuffer(self.raw); 76 | end 77 | 78 | if setupCode then 79 | terra UB:setup( context : &Gfx.Context ) 80 | var [sym] = self:map(context, Gfx.MapMode.WriteDiscard) 81 | [setupCode] 82 | self:unmap(context) 83 | end 84 | end 85 | 86 | return UB; 87 | end 88 | 89 | local attributeFormatForType = { 90 | [vec2] = Gfx.AttributeFormat.Vec2, 91 | [vec3] = Gfx.AttributeFormat.Vec3, 92 | [vec4] = Gfx.AttributeFormat.Vec4, 93 | 94 | -- TODO: other variations here!!! 95 | } 96 | 97 | function Gfx.getAttributeFormatForType(type) 98 | local format = attributeFormatForType[type]; 99 | assert(format ~= nil, "Unknown attribute format type") 100 | return format; 101 | end 102 | 103 | -- Convert an linear format to sRGB. If the format doesn't have a matching sRGB format, will return the original 104 | terra Gfx.linearToSrgbFormat(format : Gfx.TextureFormatT) 105 | if format == Gfx.TextureFormat.BC1_UNORM then 106 | return Gfx.TextureFormat.BC1_UNORM_SRGB 107 | elseif format == Gfx.TextureFormat.BC2_UNORM then 108 | return Gfx.TextureFormat.BC2_UNORM_SRGB 109 | elseif format == Gfx.TextureFormat.BC3_UNORM then 110 | return Gfx.TextureFormat.BC3_UNORM_SRGB 111 | elseif format == Gfx.TextureFormat.RGBA8 then 112 | return Gfx.TextureFormat.RGBA8_SRGB 113 | end 114 | 115 | return format 116 | end 117 | 118 | 119 | return Gfx; -------------------------------------------------------------------------------- /src/gfx.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | if not rawget(_G, "gCurrentGraphicsAPIName") then 31 | error("ERROR: Failed to specify gCurrentGraphicsAPIName prior to requiring 'gfx.t'") 32 | end 33 | 34 | return require(gCurrentGraphicsAPIName) 35 | -------------------------------------------------------------------------------- /src/pipelineWrapperSyntax.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | local WrapperBuilderExtension = require "pipelineWrapper" 31 | local Utils = require "utilities" 32 | 33 | local wrapperSyntaxExtension = { 34 | name = "WrapperExtension", 35 | keywords = { "param" }, 36 | builderExtensions = { WrapperBuilderExtension }, 37 | } 38 | 39 | function wrapperSyntaxExtension.newParser() 40 | local parser = {} 41 | 42 | function parser:parse(lex, ctorList, parserCallback) 43 | if lex:matches("param") then 44 | lex:expect("param") 45 | local paramName = lex:expect(lex.name).value 46 | lex:expect(":") 47 | local ty = lex:luaexpr() 48 | 49 | ctorList:insert(function(pb, parent, env) 50 | local member = pb:createParam(paramName, ty(env)) 51 | parent:addMember(member, member.name) 52 | end) 53 | return true 54 | end 55 | 56 | return false 57 | end 58 | 59 | return parser 60 | end 61 | 62 | local wrapperLang = Utils.shallowCopy(require("pipelinelang")) 63 | wrapperLang:addExtension(wrapperSyntaxExtension) 64 | 65 | return wrapperLang 66 | -------------------------------------------------------------------------------- /src/selos.t: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2019, The Regents of the University of California, 2 | -- Davis campus. All rights reserved. 3 | -- 4 | -- Redistribution and use in source and binary forms, with or without 5 | -- modification, are permitted provided that the following conditions 6 | -- are met: 7 | -- * Redistributions of source code must retain the above copyright 8 | -- notice, this list of conditions and the following disclaimer. 9 | -- * Redistributions in binary form must reproduce the above copyright 10 | -- notice, this list of conditions and the following disclaimer in the 11 | -- documentation and/or other materials provided with the distribution. 12 | -- * Neither the name of The Regents of the University of California, 13 | -- Davis campus nor the names of its contributors may be used to endorse 14 | -- or promote products derived from this software without specific prior 15 | -- written permission. 16 | -- 17 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 18 | -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | -- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -- 29 | 30 | local Utils = require "utilities" 31 | 32 | local MS = {} 33 | 34 | MS = Utils.combineTables(MS, require("pipelineBuilder")) 35 | 36 | return MS 37 | --------------------------------------------------------------------------------