├── .clang-format ├── .gitattributes ├── .gitignore ├── .gitmodules ├── README.md ├── SECURITY.md ├── build-instructions ├── CMakeSettings.json ├── angle-build-steps.txt └── how-to-build.txt ├── core ├── async-work-items.h ├── blob.cpp ├── blob.h ├── canvas-2d-projections.cpp ├── canvas-2d-projections.h ├── console.cpp ├── dom-events.cpp ├── dom-events.h ├── error-handling.cpp ├── event-target.cpp ├── holojs-script-host.cpp ├── holojs-script-host.h ├── host-interfaces.h ├── image-element-projections.cpp ├── image-element-projections.h ├── include │ └── holojs │ │ ├── console.h │ │ ├── holojs-script-host.h │ │ ├── holojs.h │ │ └── private │ │ ├── app-model.h │ │ ├── blob-interface.h │ │ ├── canvas-render-context-2d.h │ │ ├── chakra.h │ │ ├── error-handling.h │ │ ├── event-target.h │ │ ├── holojs-script-host-internal.h │ │ ├── holojs-view.h │ │ ├── image-interface.h │ │ ├── object-lifetime.h │ │ ├── package-reader.h │ │ ├── platform-interfaces.h │ │ ├── script-host-errors.h │ │ ├── script-host-utilities.h │ │ ├── script-window.h │ │ ├── spatial-anchors.h │ │ ├── speech-recognizer.h │ │ ├── surface-mapping.h │ │ ├── timers.h │ │ ├── webaudio-interfaces.h │ │ ├── websocket.h │ │ └── xml-http-request.h ├── promise-continuation.cpp ├── resource-management │ ├── external-object.h │ ├── resource-manager.cpp │ ├── resource-manager.h │ └── stdafx.h ├── script-context.cpp ├── script-context.h ├── script-host-utilities.cpp ├── script-loader.cpp ├── script-loader.h ├── scripts │ ├── 2d-context.js │ ├── URL.js │ ├── canvas-vr.js │ ├── canvas.js │ ├── console.js │ ├── document.js │ ├── gamepad.js │ ├── image.js │ ├── loading-animation.js │ ├── spatial-anchors.js │ ├── speech-recognizer.js │ ├── surface-mapper.js │ ├── three.js │ ├── timers.js │ ├── webaudio.js │ ├── webgl-context.js │ ├── websocket.js │ ├── webvr.js │ ├── window.js │ └── xmlhttprequest.js ├── spatial-anchors-projection.cpp ├── spatial-anchors-projection.h ├── speech-recognizer-projection.cpp ├── speech-recognizer-projection.h ├── surface-mapping-projection.cpp ├── surface-mapping-projection.h ├── timers.cpp ├── timers.h ├── webaudio │ ├── audio-buffer-source-projection.cpp │ ├── audio-buffer-source-projection.h │ ├── audio-context-projection.cpp │ ├── audio-context-projection.h │ ├── audio-listener-projection.cpp │ ├── audio-listener-projection.h │ ├── audio-node-projection.cpp │ ├── audio-node-projection.h │ ├── audio-param-projection.cpp │ ├── audio-param-projection.h │ ├── panner-node-projection.cpp │ └── panner-node-projection.h ├── webgl │ ├── webgl-objects.cpp │ ├── webgl-objects.h │ ├── webgl-projections.cpp │ ├── webgl-projections.h │ ├── webgl-rendering-context.cpp │ └── webgl-rendering-context.h ├── websocket-projection.cpp ├── websocket-projection.h ├── window-element.cpp ├── window-element.h ├── xml-http-request-projections.h └── xml-http-request.cpp ├── docs ├── app-samples.html ├── default.css ├── holojs-app.html ├── img │ ├── add-holojs-package.png │ ├── app-json-file.png │ ├── ballshooter.png │ ├── ballshooter_qr.png │ ├── breakpoint-sample.png │ ├── cloth-physics.png │ ├── debug-buttons.png │ ├── directional-sound.png │ ├── embedded-preview.png │ ├── faulty-breakpoints.png │ ├── install-error.png │ ├── loaded-scripts-collapsed.png │ ├── loaded-scripts.png │ ├── logo.png │ ├── molecule-viewer.png │ ├── moleculeviewer-qr.png │ ├── new-console-application.png │ ├── new-uwp-application.png │ ├── scripts-list.png │ ├── select-nodejs.png │ ├── spin-make-demo.mp4 │ ├── surface-mapping.jpg │ ├── surfacemapping-qr.png │ ├── uwp-package-content.png │ ├── vr-cubes.png │ ├── vr-paint.jpg │ ├── vr-paint.mp4 │ ├── vrcubes-qr.png │ ├── vrpaint-qr.png │ ├── vs-add-existing-item.png │ ├── vs-code-add-config.png │ ├── vs-debug-properties.png │ ├── vs-loaded-scripts-list.png │ ├── vs-new-filter.png │ ├── vs-project-properties.png │ ├── win32-cubes-vr.mp4 │ └── win32-cubes.png ├── index.html ├── privacy-policy-viewer.html ├── privacy-policy.html ├── qr-code.min.js ├── samples │ ├── appcode │ │ ├── ballshooter.js │ │ ├── bouncing-sound.js │ │ ├── cloth-physics.js │ │ ├── controller-view.js │ │ ├── convex-break.js │ │ ├── directional-sound.js │ │ ├── hololens-surface-mapping.js │ │ ├── lorenz-attractor.js │ │ ├── molecule-viewer.js │ │ ├── vr-cubes.js │ │ └── vr-paint.js │ ├── babylonjs │ │ └── babylon.js │ ├── ballshooter.html │ ├── ballshooter.json │ ├── bouncing-sound.json │ ├── cloth-physics.html │ ├── cloth-physics.json │ ├── controller-view.json │ ├── convex-break.json │ ├── directional-sound.html │ ├── directional-sound.json │ ├── hololens-surface-mapping.json │ ├── lorenz-attractor.json │ ├── media │ │ ├── images │ │ │ ├── arrow.jpg │ │ │ ├── arrow.png │ │ │ ├── grid.png │ │ │ ├── onepointfive_spec.png │ │ │ └── onepointfive_texture.png │ │ ├── models │ │ │ ├── gltf │ │ │ │ └── BoomBox.glb │ │ │ └── vive-controller │ │ │ │ ├── onepointfive_spec.png │ │ │ │ ├── onepointfive_texture.png │ │ │ │ └── vr_controller_vive_1_5.obj │ │ ├── sounds │ │ │ ├── 376737_Skullbeatz___Bad_Cat_Maste.mp3 │ │ │ ├── ogg_sample.ogg │ │ │ └── ping_pong.mp3 │ │ └── textures │ │ │ └── cube │ │ │ └── SwedishRoyalCastle │ │ │ ├── nx.jpg │ │ │ ├── ny.jpg │ │ │ ├── nz.jpg │ │ │ ├── px.jpg │ │ │ ├── py.jpg │ │ │ └── pz.jpg │ ├── molecule-viewer.html │ ├── molecule-viewer.json │ ├── physics │ │ └── ammo.js │ ├── threejs │ │ ├── ConvexObjectBreaker.js │ │ ├── QuickHull.js │ │ ├── VRController.js │ │ ├── WebVR.js │ │ ├── control │ │ │ └── OrbitControls.js │ │ ├── datguivr.js │ │ ├── geometries │ │ │ ├── BoxLineGeometry.js │ │ │ └── ConvexGeometry.js │ │ ├── loaders │ │ │ ├── GLTFLoader.js │ │ │ ├── OBJLoader.js │ │ │ └── PDBLoader.js │ │ └── three.js │ ├── uwp-embeded-sample │ │ ├── HoloJsApp.zip │ │ ├── holojs-app.js │ │ ├── holojs-app.json │ │ └── three.js │ ├── vr-cubes.html │ ├── vr-cubes.json │ ├── vr-paint.html │ └── vr-paint.json ├── spin-make.html ├── uwp-apps.html └── win32-apps.html ├── holojs.png ├── license.txt ├── media ├── holojs.ico └── holojs.png └── windows ├── nuget-package-spec ├── holojs.nuspec ├── holojs.props ├── holojs.targets ├── nuget.exe └── readme.txt ├── nuget └── test-apps │ ├── nuget-test-apps.sln │ ├── uwp-app │ ├── App.cpp │ ├── Assets │ │ ├── LockScreenLogo.scale-200.png │ │ ├── SplashScreen.scale-200.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ │ ├── StoreLogo.png │ │ └── Wide310x150Logo.scale-200.png │ ├── Package.appxmanifest │ ├── packages.config │ ├── pch.cpp │ ├── pch.h │ ├── uwp-app.vcxproj │ └── uwp-app.vcxproj.filters │ └── win32-app │ ├── packages.config │ ├── pch.cpp │ ├── pch.h │ ├── win32-app.cpp │ ├── win32-app.vcxproj │ └── win32-app.vcxproj.filters ├── src ├── common-lib │ ├── audio-buffer-source.h │ ├── audio-buffer.h │ ├── audio-context.cpp │ ├── audio-context.h │ ├── audio-destination-node.h │ ├── audio-listener.h │ ├── audio-node.h │ ├── audio-panner-node.h │ ├── audio-param.h │ ├── camera-resources.cpp │ ├── common-lib.vcxproj │ ├── common-lib.vcxproj.filters │ ├── device-resources.cpp │ ├── gain-node.h │ ├── include │ │ └── holojs │ │ │ └── windows │ │ │ ├── IBufferOnMemory.h │ │ │ ├── image-data.h │ │ │ ├── image-element.h │ │ │ ├── mixed-reality │ │ │ ├── camera-resources.h │ │ │ ├── device-resources.h │ │ │ ├── mixed-reality-context.h │ │ │ ├── spatial-controller.h │ │ │ └── spatial-input.h │ │ │ ├── opengl-context.h │ │ │ ├── performance-tracker.h │ │ │ ├── qr-scanner.h │ │ │ ├── speech-recognizer.h │ │ │ ├── windows-platform.h │ │ │ └── xml-http-request.h │ ├── mixed-reality-context.cpp │ ├── opengl-context.cpp │ ├── package-reader.cpp │ ├── package-reader.h │ ├── qr-scanner.cpp │ ├── spatial-anchors.cpp │ ├── spatial-anchors.h │ ├── spatial-controller.cpp │ ├── spatial-input.cpp │ ├── speech-recognizer.cpp │ ├── stdafx.cpp │ ├── stdafx.h │ ├── surface-mapper.cpp │ ├── surface-mapper.h │ ├── targetver.h │ ├── websocket.cpp │ ├── websocket.h │ ├── windows-image-element.cpp │ ├── windows-platform.cpp │ └── windows-xml-http-request.cpp ├── context2d-lib │ ├── context2d-lib.vcxproj │ ├── context2d-lib.vcxproj.filters │ ├── include │ │ └── holojs │ │ │ └── windows │ │ │ └── render-context-2d.h │ ├── render-context-2d.cpp │ ├── stdafx.cpp │ ├── stdafx.h │ ├── targetver.h │ └── win2d-c-interface.h ├── core-lib │ ├── core-lib.vcxproj │ ├── core-lib.vcxproj.filters │ └── targetver.h ├── dotnet-component │ ├── HoloJsScriptHost.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ScriptRenderHost.cs │ └── dotnet-component.csproj ├── test │ ├── unittest │ │ ├── EventTargetTests.cpp │ │ ├── basic-tests.cpp │ │ ├── blob-tests.cpp │ │ ├── blob-tests.h │ │ ├── common-unittest.vcxproj │ │ ├── common-unittest.vcxproj.filters │ │ ├── console-tests.cpp │ │ ├── console-tests.h │ │ ├── event-target-tests.h │ │ ├── http-server │ │ │ ├── post-server.py │ │ │ ├── test-content │ │ │ │ ├── appcode │ │ │ │ │ └── ballshooter.js │ │ │ │ ├── ballshooter.xrs │ │ │ │ ├── bouncing-sound.xrs │ │ │ │ ├── media │ │ │ │ │ └── sounds │ │ │ │ │ │ └── ping_pong.mp3 │ │ │ │ └── threejs │ │ │ │ │ ├── control │ │ │ │ │ └── OrbitControls.js │ │ │ │ │ ├── geometries │ │ │ │ │ ├── BoxLineGeometry.js │ │ │ │ │ └── ConvexGeometry.js │ │ │ │ │ └── three.js │ │ │ ├── websocket_server-runner.py │ │ │ ├── websocket_server.py │ │ │ └── websocket_server.pyc │ │ ├── image-tests.cpp │ │ ├── image-tests.h │ │ ├── resource-utilization-tests.cpp │ │ ├── resource-utilization-tests.h │ │ ├── spatial-anchor-test.cpp │ │ ├── spatial-anchor-test.h │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ ├── targetver.h │ │ ├── timer-tests.cpp │ │ ├── timer-tests.h │ │ ├── web-loader-tests.cpp │ │ ├── web-loader-tests.h │ │ ├── webaudio-tests.cpp │ │ ├── webaudio-tests.h │ │ ├── websocket-test.cpp │ │ ├── websocket-test.h │ │ ├── window-tests.cpp │ │ ├── window-tests.h │ │ ├── xhr-tests.cpp │ │ └── xhr-tests.h │ ├── uwp │ │ ├── App.cpp │ │ ├── App.h │ │ ├── Assets │ │ │ ├── LockScreenLogo.scale-200.png │ │ │ ├── SplashScreen.scale-200.png │ │ │ ├── Square150x150Logo.scale-200.png │ │ │ ├── Square44x44Logo.scale-200.png │ │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ │ │ ├── StoreLogo.png │ │ │ └── Wide310x150Logo.scale-200.png │ │ ├── Package.appxmanifest │ │ ├── pch.cpp │ │ ├── pch.h │ │ ├── uwp-test.vcxproj │ │ └── uwp-test.vcxproj.filters │ └── win32 │ │ ├── holojs_test.cpp │ │ ├── pch.cpp │ │ ├── pch.h │ │ ├── test-console-config.h │ │ ├── win32-test.vcxproj │ │ └── win32-test.vcxproj.filters ├── uwp-component │ ├── dllmain.cpp │ ├── file-handle-access.h │ ├── scripts │ │ ├── 2d-context.js │ │ ├── console.js │ │ ├── dom.js │ │ ├── gamepad.js │ │ ├── timers.js │ │ ├── webgl-context.js │ │ ├── webvr.js │ │ ├── window.js │ │ └── xmlhttprequest.js │ ├── stdafx.cpp │ ├── stdafx.h │ ├── targetver.h │ ├── uwp-component.vcxproj │ ├── uwp-component.vcxproj.filters │ ├── uwp-mixed-reality-context.cpp │ ├── uwp-mixed-reality-context.h │ ├── uwp-opengl-context.cpp │ ├── uwp-opengl-context.h │ ├── uwp-spatial-input.cpp │ ├── uwp-spatial-input.h │ └── uwp │ │ ├── stdafx.h │ │ ├── uwp-platform.cpp │ │ ├── uwp-platform.h │ │ ├── winrt-timers-implementation.cpp │ │ ├── winrt-timers-implementation.h │ │ ├── winrt-view.cpp │ │ └── winrt-view.h ├── win-holojs.sln └── win32-component │ ├── debug-protocol-handler.h │ ├── debug-service.h │ ├── dllmain.cpp │ ├── packages.config │ ├── performance-tracker.h │ ├── script-debugger.cpp │ ├── script-debugger.h │ ├── script-resources.h │ ├── script-resources.rc │ ├── stdafx.cpp │ ├── stdafx.h │ ├── targetver.h │ ├── win32-base-view.cpp │ ├── win32-base-view.h │ ├── win32-component.vcxproj │ ├── win32-component.vcxproj.filters │ ├── win32-embedded-view.cpp │ ├── win32-embedded-view.h │ ├── win32-mixed-reality-context.cpp │ ├── win32-mixed-reality-context.h │ ├── win32-opengl-context.cpp │ ├── win32-opengl-context.h │ ├── win32-platform.cpp │ ├── win32-platform.h │ ├── win32-spatial-input.cpp │ ├── win32-spatial-input.h │ ├── win32-timers-implementation.cpp │ ├── win32-timers-implementation.h │ ├── win32-view.cpp │ └── win32-view.h └── utilities ├── spin ├── media │ ├── attractor-parameters.png │ ├── logo-black-background.ico │ ├── logo-black-background.png │ ├── logo-black-background.psd │ ├── logo.ico │ ├── logo.png │ ├── logo.psd │ ├── store-poster-viewer.psd │ ├── store-poster.psd │ └── viewer-logo.png ├── spin-certificate.cer ├── spin.sln ├── spin │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── AppServer.cs │ ├── ProjectGenerator.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── QrConnect.xaml │ ├── QrConnect.xaml.cs │ ├── ScriptApp.cs │ ├── SpinSwitches.cs │ ├── logo-black-background.ico │ ├── packages.config │ ├── spin.csproj │ └── templates │ │ └── three_template.js └── viewer │ ├── App.cpp │ ├── Assets │ ├── LargeTile.scale-100.png │ ├── LargeTile.scale-125.png │ ├── LargeTile.scale-150.png │ ├── LargeTile.scale-200.png │ ├── LargeTile.scale-400.png │ ├── LockScreenLogo.scale-200.png │ ├── SmallTile.scale-100.png │ ├── SmallTile.scale-125.png │ ├── SmallTile.scale-150.png │ ├── SmallTile.scale-200.png │ ├── SmallTile.scale-400.png │ ├── SplashScreen.scale-100.png │ ├── SplashScreen.scale-125.png │ ├── SplashScreen.scale-150.png │ ├── SplashScreen.scale-200.png │ ├── SplashScreen.scale-400.png │ ├── Square150x150Logo.scale-100.png │ ├── Square150x150Logo.scale-125.png │ ├── Square150x150Logo.scale-150.png │ ├── Square150x150Logo.scale-200.png │ ├── Square150x150Logo.scale-400.png │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ ├── Square44x44Logo.altform-unplated_targetsize-32.png │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ ├── Square44x44Logo.scale-100.png │ ├── Square44x44Logo.scale-125.png │ ├── Square44x44Logo.scale-150.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.scale-400.png │ ├── Square44x44Logo.targetsize-16.png │ ├── Square44x44Logo.targetsize-24.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── Square44x44Logo.targetsize-256.png │ ├── Square44x44Logo.targetsize-32.png │ ├── Square44x44Logo.targetsize-48.png │ ├── StoreLogo.backup.png │ ├── StoreLogo.scale-100.png │ ├── StoreLogo.scale-125.png │ ├── StoreLogo.scale-150.png │ ├── StoreLogo.scale-200.png │ ├── StoreLogo.scale-400.png │ ├── Wide310x150Logo.scale-100.png │ ├── Wide310x150Logo.scale-125.png │ ├── Wide310x150Logo.scale-150.png │ ├── Wide310x150Logo.scale-200.png │ └── Wide310x150Logo.scale-400.png │ ├── Package.StoreAssociation.xml │ ├── Package.appxmanifest │ ├── _pkginfo.txt │ ├── packages.config │ ├── pch.cpp │ ├── pch.h │ ├── viewer.vcxproj │ └── viewer.vcxproj.filters └── webgl-code-generator ├── App.config ├── App.xaml ├── App.xaml.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── WebAudioGenerator.xaml ├── WebAudioGenerator.xaml.cs ├── webgl-code-generator.csproj ├── webgl-code-generator.sln └── webgl-functions.txt /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: Google 2 | IndentWidth: 4 3 | ColumnLimit: 120 4 | AlignAfterOpenBracket: Align 5 | BinPackParameters: false 6 | BinPackArguments: false 7 | BreakBeforeBraces: Custom 8 | BraceWrapping: 9 | AfterFunction: true 10 | 11 | IncludeCategories: 12 | - Regex: 'pch.h' 13 | Priority: -1 14 | - Regex: 'stdafx.h' 15 | Priority: 0 16 | - Regex: 'jsrt.h' 17 | Priority: 5 18 | - Regex: 'chakrart.h' 19 | Priority: 6 20 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "LabSound"] 2 | path = deps/LabSound 3 | url = https://github.com/Almost-Done/LabSound.git 4 | branch = master 5 | [submodule "angle-google"] 6 | path = deps/angle-google 7 | url = https://github.com/google/angle.git 8 | [submodule "angle-microsoft"] 9 | path = deps/angle-microsoft 10 | url = https://github.com/Almost-Done/angle.git 11 | branch = ms-master 12 | [submodule "Win2D"] 13 | path = deps/Win2D 14 | url = https://github.com/Almost-Done/Win2D.git 15 | [submodule "deps/ChakraCore"] 16 | path = deps/ChakraCore 17 | url = https://github.com/Microsoft/ChakraCore.git 18 | [submodule "deps/ChakraCore-Debugger"] 19 | path = deps/ChakraCore-Debugger 20 | url = https://github.com/Microsoft/ChakraCore-Debugger.git 21 | [submodule "deps/ziplib"] 22 | path = deps/ziplib 23 | url = https://bitbucket.org/wbenny/ziplib.git 24 | [submodule "deps/zxing-cpp"] 25 | path = deps/zxing-cpp 26 | url = https://github.com/nu-book/zxing-cpp.git 27 | -------------------------------------------------------------------------------- /build-instructions/CMakeSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32-Debug", 5 | "generator": "Ninja", 6 | "configurationType": "Debug", 7 | "inheritEnvironments": [ 8 | "msvc_x86" 9 | ], 10 | "buildRoot": "${projectDir}\\build\\${name}", 11 | "installRoot": "${projectDir}\\install\\${name}", 12 | "cmakeCommandArgs": "", 13 | "buildCommandArgs": "-v", 14 | "ctestCommandArgs": "" 15 | }, 16 | { 17 | "name": "Win32-Release", 18 | "generator": "Ninja", 19 | "configurationType": "Release", 20 | "inheritEnvironments": [ 21 | "msvc_x86" 22 | ], 23 | "buildRoot": "${projectDir}\\build\\${name}", 24 | "installRoot": "${projectDir}\\install\\${name}", 25 | "cmakeCommandArgs": "", 26 | "buildCommandArgs": "-v", 27 | "ctestCommandArgs": "" 28 | }, 29 | { 30 | "name": "x64-Release", 31 | "generator": "Ninja", 32 | "configurationType": "Release", 33 | "inheritEnvironments": [ 34 | "msvc_x64" 35 | ], 36 | "buildRoot": "${projectDir}\\build\\${name}", 37 | "installRoot": "${projectDir}\\install\\${name}", 38 | "cmakeCommandArgs": "", 39 | "buildCommandArgs": "-v", 40 | "ctestCommandArgs": "" 41 | }, 42 | { 43 | "name": "x64-Debug", 44 | "generator": "Ninja", 45 | "configurationType": "Debug", 46 | "inheritEnvironments": [ 47 | "msvc_x64" 48 | ], 49 | "buildRoot": "${projectDir}\\build\\${name}", 50 | "installRoot": "${projectDir}\\install\\${name}", 51 | "cmakeCommandArgs": "", 52 | "buildCommandArgs": "-v", 53 | "ctestCommandArgs": "" 54 | } 55 | ] 56 | } -------------------------------------------------------------------------------- /build-instructions/angle-build-steps.txt: -------------------------------------------------------------------------------- 1 | 1. download and install python3 2 | 2. download depot-tools from https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up 3 | 3. add depot_tools to PATH variable, after python3 4 | 4. add environment variable DEPOT_TOOLS_WIN_TOOLCHAIN=0 5 | 5. open a new command prompt 6 | 6. change directory to deps\angle-google 7 | 7. run "python scripts/bootstrap.py" 8 | 8. gclient sync 9 | 10 | 9. gn args out/Debug-x64 11 | paste in the editor: 12 | target_cpu = "x64" 13 | is_clang = false 14 | is_debug = true 15 | 16 | 10. gn args out/Release-x64 17 | paste in the editor: 18 | target_cpu = "x64" 19 | is_clang = false 20 | is_debug = false 21 | 22 | 11. gn args out/Debug-Win32 23 | paste in the editor: 24 | target_cpu = "x86" 25 | is_clang = false 26 | is_debug = true 27 | 28 | 12. gn args out/Release-Win32 29 | paste in the editor: 30 | target_cpu = "x86" 31 | is_clang = false 32 | is_debug = false 33 | 34 | 13. python scripts/msvs_projects.py 35 | 36 | 14. open angle-google\out\sln 37 | Build the "all" project for all configurations (Debug-Win32, Debug-x64, etc.) 38 | Do not change the platform, it is always x64 even when building Debug-Win32 etc. 39 | -------------------------------------------------------------------------------- /build-instructions/how-to-build.txt: -------------------------------------------------------------------------------- 1 | 1. Make sure to clone all submodules 2 | git submodule init 3 | git submodule update --recursive 4 | 5 | cd deps\LabSound 6 | git submodule init 7 | git submodule update 8 | 9 | cd deps\ChakraCore-Debugger 10 | git submodule init 11 | git submodule update 12 | 13 | 2. Build angle-microsoft from deps\angle-microsoft\winrt\10\src\angle.sln 14 | Debug and Release, X86 and X64 15 | 16 | 3. Build google-angle. See angle-build-steps.txt for details 17 | 18 | 4. Build win2d from deps\win2d\Win2D.uap.sln 19 | Debug and Release, X64 and X86 20 | 21 | 5. Build LabSound 22 | a. Copy build-instructions/CMakeSettings.json to deps/LabSound 23 | b. Open the LabSound CMake project in Visual Studio 24 | c. Build for all configurations 25 | 26 | 6. Build ChakraCore (x64 and x86) from deps\ChakraCore\Build\Chakra.Core.sln 27 | 28 | 7. Build ChakraCore-Debugger 29 | 30 | 8. Build zxing 31 | a. Copy build-instructions/CMakeSettings.json to deps/zxing-cpp/core 32 | b. Open the ZXing srcCMake project from deps/zxing-cpp/core in Visual Studio 33 | c. Build for all configurations 34 | 35 | 9. Open and build windows\src\win-holojs.sln -------------------------------------------------------------------------------- /core/blob.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "include/holojs/private/blob-interface.h" 4 | #include "include/holojs/private/chakra.h" 5 | #include "include/holojs/private/object-lifetime.h" 6 | #include 7 | #include 8 | 9 | namespace HoloJs { 10 | namespace Interfaces { 11 | 12 | class BlobProjection { 13 | public: 14 | BlobProjection(std::shared_ptr resourceManager) 15 | : m_resourceManager(resourceManager){} 16 | 17 | long initialize(); 18 | 19 | private: 20 | JS_PROJECTION_DEFINE(BlobProjection, create) 21 | std::shared_ptr m_resourceManager; 22 | }; 23 | 24 | class Blob : public HoloJs::ResourceManagement::IRelease, public HoloJs::IBlob { 25 | public: 26 | virtual ~Blob() {} 27 | static Blob* fromScriptData(JsValueRef blobParts, 28 | JsValueRef options, 29 | std::shared_ptr resourceManager); 30 | 31 | virtual std::shared_ptr> data() { return m_data; } 32 | virtual std::wstring mimeType() { return m_mimeType; } 33 | 34 | void Release() {} 35 | 36 | Blob() {} 37 | 38 | private: 39 | 40 | std::shared_ptr> m_data; 41 | std::wstring m_mimeType; 42 | }; 43 | 44 | } // namespace Interfaces 45 | } // namespace HoloJs 46 | -------------------------------------------------------------------------------- /core/dom-events.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "include/holojs/private/chakra.h" 4 | #include "include/holojs/private/event-target.h" 5 | #include 6 | #include 7 | #include 8 | 9 | namespace HoloJs { 10 | namespace Interfaces { 11 | 12 | class DOMEventRegistration { 13 | public: 14 | DOMEventRegistration() {} 15 | ~DOMEventRegistration() {} 16 | 17 | long initialize(); 18 | 19 | private: 20 | JS_PROJECTION_WITH_CONTEXT_DEFINE(DOMEventRegistration, addEventListener) 21 | JS_PROJECTION_WITH_CONTEXT_DEFINE(DOMEventRegistration, removeEventListener) 22 | JS_PROJECTION_DEFINE(DOMEventRegistration, dispatchEvent) 23 | }; 24 | 25 | } // namespace Interfaces 26 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/error-handling.cpp: -------------------------------------------------------------------------------- 1 | #include "include/holojs/private/error-handling.h" 2 | #include "include/holojs/private/chakra.h" 3 | #include "include/holojs/private/platform-interfaces.h" 4 | #include 5 | 6 | long HoloJs::Error = -1; 7 | long HoloJs::Success = 0; 8 | 9 | void Log(const char* file, int line) 10 | { 11 | std::string completeOutput = "Failure in file "; 12 | completeOutput += file; 13 | completeOutput += ", line "; 14 | completeOutput += std::to_string(line); 15 | completeOutput += "\r\n"; 16 | 17 | HoloJs::getPlatform()->debugLog(completeOutput.c_str()); 18 | } 19 | 20 | void PrintException() 21 | { 22 | // Get error message 23 | JsValueRef exception; 24 | EXIT_IF_JS_ERROR(JsGetAndClearException(&exception)); 25 | 26 | JsPropertyIdRef messageName; 27 | EXIT_IF_JS_ERROR(JsGetPropertyIdFromName(L"stack", &messageName)); 28 | 29 | JsValueRef messageValue; 30 | EXIT_IF_JS_ERROR(JsGetProperty(exception, messageName, &messageValue)); 31 | 32 | const wchar_t* message; 33 | size_t length; 34 | EXIT_IF_JS_ERROR(JsStringToPointer(messageValue, &message, &length)); 35 | 36 | std::wstring output = (message != nullptr ? message : L"No exception message available"); 37 | output += L"\r\n"; 38 | 39 | HoloJs::getPlatform()->debugLog(output.c_str()); 40 | } -------------------------------------------------------------------------------- /core/include/holojs/console.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace HoloJs { 4 | enum class ConsoleCallbackMode { RunDefaultBehavior, OverrideDefaultBehavior }; 5 | 6 | class IConsoleConfiguration { 7 | public: 8 | virtual ~IConsoleConfiguration() {} 9 | 10 | virtual void onConsoleLog(const wchar_t* message) = 0; 11 | virtual void onConsoleDebug(const wchar_t* message) = 0; 12 | 13 | ConsoleCallbackMode callbackMode; 14 | }; 15 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/holojs-script-host.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace HoloJs { 4 | 5 | class IConsoleConfiguration; 6 | 7 | enum class ViewMode 8 | { 9 | None = 0, 10 | Default, 11 | Flat, 12 | FlatEmbedded, 13 | VR 14 | }; 15 | 16 | #pragma pack (push, 4) 17 | struct ViewConfiguration 18 | { 19 | ViewMode viewMode; 20 | bool enableVoiceCommands; 21 | bool enableQrCodeNavigation; 22 | }; 23 | #pragma pack (pop) 24 | 25 | class IHoloJsScriptHost { 26 | public: 27 | virtual ~IHoloJsScriptHost() {} 28 | virtual long initialize(ViewConfiguration viewConfig) = 0; 29 | virtual void setViewWindow(void* nativeWindow) = 0; 30 | 31 | virtual long startUri(const wchar_t* appUri) = 0; 32 | virtual long start(const wchar_t* script) = 0; 33 | virtual long startWithEmptyApp() = 0; 34 | 35 | virtual long execute(const wchar_t* script) = 0; 36 | virtual long executeUri(const wchar_t* scriptUri) = 0; 37 | virtual long executePackageFromHandle(void* platformPackageHandle) = 0; 38 | virtual long executeImmediate(const wchar_t* script, const wchar_t* scriptName) = 0; 39 | 40 | virtual long stopExecution() = 0; 41 | 42 | virtual void enableDebugger() = 0; 43 | 44 | virtual void setConsoleConfig(HoloJs::IConsoleConfiguration* consoleConfig) = 0; 45 | 46 | virtual void setWindowIcon(void* platformIcon) = 0; 47 | virtual void setWindowTitle(const wchar_t* title ) = 0; 48 | }; 49 | 50 | __declspec(dllexport) HoloJs::IHoloJsScriptHost* __cdecl CreateHoloJsScriptHost(); 51 | __declspec(dllexport) void __cdecl DeleteHoloJsScriptHost(HoloJs::IHoloJsScriptHost* scriptHost); 52 | 53 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/holojs.h: -------------------------------------------------------------------------------- 1 | #ifdef HOLO_JS_UWP 2 | #else 3 | #endif 4 | 5 | #include "console.h" 6 | #include "holojs-script-host.h" -------------------------------------------------------------------------------- /core/include/holojs/private/blob-interface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace HoloJs { 7 | 8 | class IBlob { 9 | public: 10 | virtual std::shared_ptr> data() = 0; 11 | virtual std::wstring mimeType() = 0; 12 | }; 13 | 14 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/private/event-target.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "chakra.h" 4 | #include 5 | #include 6 | #include 7 | 8 | namespace HoloJs { 9 | 10 | class EventTarget { 11 | public: 12 | virtual long addEventListener(const std::wstring &eventName, JsValueRef handler, JsValueRef handlerContext); 13 | virtual long removeEventListener(const std::wstring &eventName, JsValueRef handler); 14 | virtual long invokeEventListeners(const std::wstring &eventName); 15 | virtual long invokeEventListeners(const std::wstring &eventName, JsValueRef argument); 16 | virtual long invokeEventListeners(const std::wstring &eventName, const std::vector &arguments); 17 | 18 | ~EventTarget(); 19 | 20 | protected: 21 | JsValueRef m_scriptCallback = JS_INVALID_REFERENCE; 22 | JsValueRef m_scriptCallbackContext = JS_INVALID_REFERENCE; 23 | 24 | std::map> m_handlerMap; 25 | }; 26 | 27 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/private/holojs-script-host-internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../holojs-script-host.h" 4 | #include "app-model.h" 5 | #include "holojs-view.h" 6 | #include "object-lifetime.h" 7 | #include "script-window.h" 8 | #include 9 | namespace HoloJs { 10 | 11 | enum class HostRenderedElements { None, LoadingAnimation, LoadingFailed, NothingLoaded, QrScanGuide }; 12 | 13 | class IHoloJsScriptHostInternal : public IHoloJsScriptHost { 14 | public: 15 | virtual HoloJs::IWindow* getWindowElement() = 0; 16 | 17 | virtual long createScriptObject(HoloJs::ResourceManagement::IRelease* nativeObject, 18 | HoloJs::ResourceManagement::ObjectType type, 19 | JsValueRef* scriptObjet) = 0; 20 | 21 | virtual long getActiveAppConfiguration(HoloJs::AppModel::AppConfiguration* configuration) = 0; 22 | 23 | virtual long runInBackground(std::function backgroundWork) = 0; 24 | virtual long runInScriptContext(std::function contextWork) = 0; 25 | 26 | virtual long getStationaryCoordinateSystem(void** coordinateSystem) = 0; 27 | 28 | virtual long createExecutionContext() = 0; 29 | virtual long executeLoadedApp(std::shared_ptr app) = 0; 30 | 31 | virtual long showHostRenderedElement(HoloJs::HostRenderedElements element) = 0; 32 | }; 33 | 34 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/private/holojs-view.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "app-model.h" 4 | #include "script-host-errors.h" 5 | #include 6 | #include 7 | 8 | namespace HoloJs { 9 | 10 | class IHoloJsScriptHostInternal; 11 | 12 | class IBackgroundWorkItem { 13 | public: 14 | virtual ~IBackgroundWorkItem() {} 15 | virtual long execute() = 0; 16 | }; 17 | 18 | class IForegroundWorkItem { 19 | public: 20 | virtual ~IForegroundWorkItem(){} 21 | virtual void execute() = 0; 22 | virtual long long getTag() = 0; 23 | }; 24 | 25 | class IHoloJsView { 26 | public: 27 | virtual ~IHoloJsView() {} 28 | 29 | virtual long initialize(IHoloJsScriptHostInternal* host) = 0; 30 | virtual void setViewWindow(void* nativeWindow) = 0; 31 | virtual void run() = 0; 32 | virtual void stop() = 0; 33 | 34 | virtual long executeApp(std::shared_ptr app) = 0; 35 | virtual long executeScript(const wchar_t* script) = 0; 36 | 37 | virtual long executeOnViewThread(IForegroundWorkItem* workItem) = 0; 38 | virtual long executeInBackground(IBackgroundWorkItem* workItem) = 0; 39 | 40 | virtual void onError(HoloJs::ScriptHostErrorType errorType) = 0; 41 | 42 | virtual bool isWindingOrderReversed() = 0; 43 | 44 | virtual void setIcon(void* platformIcon) = 0; 45 | 46 | virtual void setTitle(const std::wstring& title) = 0; 47 | 48 | virtual long getStationaryCoordinateSystem(void** coordinateSystem) = 0; 49 | }; 50 | 51 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/private/image-interface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "blob-interface.h" 4 | #include "chakra.h" 5 | #include "event-target.h" 6 | #include "holojs-view.h" 7 | #include "object-lifetime.h" 8 | 9 | namespace HoloJs { 10 | 11 | typedef struct _IMAGE_FORMAT_GUID { 12 | DWORD Data1; 13 | WORD Data2; 14 | WORD Data3; 15 | BYTE Data4[8]; 16 | } IMAGE_FORMAT_GUID; 17 | 18 | enum class ImageFlipRotation { None, FlipY }; 19 | 20 | class IImageData { 21 | public: 22 | IMAGE_FORMAT_GUID m_decodedFormat; 23 | 24 | byte* m_pixels; 25 | unsigned int m_pixelsSize; 26 | unsigned int m_stride; 27 | 28 | virtual ~IImageData() {}; 29 | }; 30 | 31 | class IIMage : public HoloJs::EventTarget, public HoloJs::ResourceManagement::IRelease { 32 | public: 33 | virtual ~IIMage() {} 34 | 35 | virtual long setSource(const std::wstring& source, JsValueRef imageRef) = 0; 36 | virtual long setSourceFromBlob(JsValueRef blobRef, IBlob* blob, JsValueRef imageRef) = 0; 37 | 38 | virtual long getImageData(const IMAGE_FORMAT_GUID& imageFormat, 39 | IImageData** imageData, 40 | ImageFlipRotation flipOperation) = 0; 41 | 42 | virtual unsigned int getWidth() = 0; 43 | virtual unsigned int getHeight() = 0; 44 | }; 45 | 46 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/private/object-lifetime.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "chakra.h" 4 | #include 5 | #include 6 | 7 | namespace HoloJs { 8 | 9 | namespace ResourceManagement { 10 | 11 | enum class ObjectType { 12 | Blob, 13 | Window, 14 | ICanvasRenderContext2D, 15 | IImage, 16 | WebGLContext, 17 | WebGLShaderPrecisionFormat, 18 | WebGLRenderbuffer, 19 | WebGLFramebuffer, 20 | WebGLTexture, 21 | WebGLBuffer, 22 | WebGLActiveInfo, 23 | WebGLProgram, 24 | WebGLShader, 25 | WebGLUniformLocation, 26 | IXmlHttpRequest, 27 | IAudioBuffer, 28 | IGainNode, 29 | IAudioContext, 30 | IAudioDestinationNode, 31 | IAudioBufferSource, 32 | IPannerNode, 33 | IAudioListener, 34 | IAudioNode, 35 | IAudioParam, 36 | IWebSocket, 37 | ISurfaceMapper, 38 | ISpeechRecognizer, 39 | ISpatialAnchor, 40 | ISpatialAnchorStore, 41 | None 42 | }; 43 | 44 | class ResourceManager; 45 | 46 | class IRelease { 47 | public: 48 | virtual void Release() = 0; 49 | 50 | virtual ~IRelease() {} 51 | }; 52 | 53 | } // namespace ResourceManagement 54 | 55 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/private/package-reader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace HoloJs { 7 | 8 | class IPackageReader { 9 | public: 10 | virtual long readFileFromPackageUTF8(const std::wstring& filePath, std::wstring& text) = 0; 11 | virtual long readFileFromPackageUnicode(const std::wstring& filePath, std::wstring& text) = 0; 12 | virtual long readFileFromPackageBinary(const std::wstring& filePath, std::vector& data) = 0; 13 | }; 14 | 15 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/private/script-host-errors.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace HoloJs { 4 | enum class ScriptHostErrorType { 5 | LoadingError 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /core/include/holojs/private/script-window.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "chakra.h" 4 | #include 5 | namespace HoloJs { 6 | 7 | class IHoloJsScriptHost; 8 | 9 | enum class KeyEventType { KeyDown, KeyUp }; 10 | 11 | enum class MouseButtonEventType { Down, Up, Move, Wheel, Click, DblClick }; 12 | 13 | enum class MouseButton { 14 | Main = 0, 15 | Auxiliary = 1, 16 | Second = 2 17 | }; 18 | 19 | class IWindow { 20 | public: 21 | virtual long initialize() = 0; 22 | 23 | virtual long resize(int width, int height) = 0; 24 | virtual long vSync() = 0; 25 | virtual long deviceLost() = 0; 26 | virtual long deviceRestored() = 0; 27 | 28 | virtual long gamepadConnected(JsValueRef gamepadEvent) = 0; 29 | virtual long gamepadDisconnected(JsValueRef gamepadEvent) = 0; 30 | 31 | virtual long keyEvent( 32 | KeyEventType type, const std::wstring& key, const std::wstring& code, int location, int keyCode) = 0; 33 | virtual long mouseEvent(MouseButtonEventType type, int x, int y, int button, int buttons) = 0; 34 | 35 | virtual long setHeadsetAvailable(bool available) = 0; 36 | }; 37 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/private/spatial-anchors.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "chakra.h" 4 | #include "event-target.h" 5 | #include "holojs-view.h" 6 | #include "object-lifetime.h" 7 | #include 8 | #include 9 | 10 | namespace HoloJs { 11 | 12 | class ISpatialAnchor : public HoloJs::ResourceManagement::IRelease { 13 | public: 14 | virtual ~ISpatialAnchor() {} 15 | virtual bool isPersisted() = 0; 16 | virtual long getName(std::wstring& name) = 0; 17 | virtual long tryGetPositionRelativeTo(HoloJs::IHoloJsScriptHostInternal* host, 18 | HoloJs::ISpatialAnchor* other, 19 | std::array& position, 20 | std::array& orientation) = 0; 21 | }; 22 | 23 | class ISpatialAnchorsStore : public HoloJs::ResourceManagement::IRelease { 24 | public: 25 | virtual std::vector enumerate() = 0; 26 | virtual long open(const std::wstring& name, HoloJs::ISpatialAnchor** anchor) = 0; 27 | virtual long deleteAnchor(const std::wstring& name) = 0; 28 | virtual bool areAnchorsImplemented() = 0; 29 | virtual long save(HoloJs::ISpatialAnchor* anchor, const std::wstring& anchorName) = 0; 30 | virtual void initialize(JsValueRef storeRef) = 0; 31 | }; 32 | 33 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/private/speech-recognizer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "chakra.h" 4 | #include "event-target.h" 5 | #include "holojs-view.h" 6 | #include "object-lifetime.h" 7 | 8 | namespace HoloJs { 9 | 10 | typedef std::function OnSpeechRecognizerResult; 11 | 12 | class ISpeechRecognizer : public HoloJs::ResourceManagement::IRelease { 13 | public: 14 | virtual ~ISpeechRecognizer() {} 15 | 16 | virtual long start(JsValueRef recognizerRef) = 0; 17 | virtual long stop() = 0; 18 | 19 | virtual void enableFreeFormDictation(bool enabled) = 0; 20 | virtual void setKeywords(const std::vector& keywords) = 0; 21 | 22 | virtual void setOnResultsCallback(OnSpeechRecognizerResult callback) = 0; 23 | }; 24 | 25 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/private/surface-mapping.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "chakra.h" 4 | #include "event-target.h" 5 | #include "holojs-view.h" 6 | #include "object-lifetime.h" 7 | #include "blob-interface.h" 8 | 9 | namespace HoloJs { 10 | 11 | class ISurfaceMapper : public HoloJs::ResourceManagement::IRelease { 12 | public: 13 | virtual ~ISurfaceMapper() {} 14 | 15 | virtual long start(JsValueRef mapperRef) = 0; 16 | virtual long stop() = 0; 17 | 18 | virtual void setBoundingCube( 19 | float centerX, float centerY, float centerZ, float extentX, float extentY, float extentZ) = 0; 20 | 21 | virtual void getBoundingCube( 22 | float* centerX, float* centerY, float* centerZ, float* extentX, float* extentY, float* extentZ) = 0; 23 | 24 | virtual void getTriangleDensity(float* triangleDensity) = 0; 25 | virtual void setTriangleDensity(float triangleDensity) = 0; 26 | }; 27 | 28 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/private/websocket.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "event-target.h" 4 | #include "holojs-view.h" 5 | #include "object-lifetime.h" 6 | #include "blob-interface.h" 7 | #include 8 | 9 | namespace HoloJs { 10 | 11 | class IWebSocket : public HoloJs::ResourceManagement::IRelease { 12 | public: 13 | 14 | virtual ~IWebSocket() {} 15 | virtual int getReadyState() = 0; 16 | 17 | virtual void connect(const std::wstring& url, const std::vector& protocols) = 0; 18 | 19 | virtual void send(const std::wstring& message) = 0; 20 | virtual void send(unsigned char* data, unsigned int dataSize, JsValueRef dataRef) = 0; 21 | virtual void send(HoloJs::IBlob* blob, JsValueRef dataRef) = 0; 22 | 23 | virtual void close(int code, const std::wstring& reason) = 0; 24 | }; 25 | 26 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/include/holojs/private/xml-http-request.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "event-target.h" 4 | #include "holojs-view.h" 5 | #include "object-lifetime.h" 6 | 7 | namespace HoloJs { 8 | 9 | class IXmlHttpRequest : public HoloJs::EventTarget, public HoloJs::ResourceManagement::IRelease { 10 | public: 11 | 12 | virtual ~IXmlHttpRequest() {} 13 | 14 | virtual long createHttpContent(JsValueRef payload) = 0; 15 | 16 | virtual long send(const std::wstring& method, 17 | const std::wstring& uri, 18 | const std::wstring& type, 19 | JsValueRef xhrRef) = 0; 20 | 21 | virtual void setRequestHeader(const std::wstring& name, const std::wstring& value) = 0; 22 | 23 | virtual JsValueRef getResponseHeader(const std::wstring& name) = 0; 24 | }; 25 | 26 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/promise-continuation.cpp: -------------------------------------------------------------------------------- 1 | #include "host-interfaces.h" 2 | 3 | using namespace HoloJs::Interfaces; 4 | 5 | void PromiseContinuation::staticPromiseContinuationCallback(JsValueRef task, void* callbackState) 6 | { 7 | reinterpret_cast(callbackState)->promiseContinuationCallback(task); 8 | } 9 | 10 | void PromiseContinuation::promiseContinuationCallback(JsValueRef task) 11 | { 12 | EXIT_IF_JS_ERROR(JsAddRef(task, nullptr)); 13 | auto autoReleaseTask = JsRefReleaseAtScopeExit(task); 14 | 15 | JsValueRef result; 16 | JsValueRef global; 17 | EXIT_IF_JS_ERROR(JsGetGlobalObject(&global)); 18 | 19 | HANDLE_EXCEPTION_IF_JS_ERROR(JsCallFunction(task, &global, 1, &result)); 20 | } 21 | 22 | HRESULT PromiseContinuation::initialize() 23 | { 24 | RETURN_IF_JS_ERROR(JsSetPromiseContinuationCallback(staticPromiseContinuationCallback, this)); 25 | return S_OK; 26 | } -------------------------------------------------------------------------------- /core/resource-management/external-object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../dom-events.h" 4 | #include "../include/holojs/private/object-lifetime.h" 5 | 6 | namespace HoloJs { 7 | 8 | namespace ResourceManagement { 9 | 10 | class ResourceManager; 11 | 12 | class ExternalObject { 13 | public: 14 | ExternalObject(ResourceManager* resourceTracker) : m_resourceTracker(resourceTracker) {} 15 | 16 | template 17 | HRESULT initialize(T* object, ObjectType type, ObjectType baseType = ObjectType::None) 18 | { 19 | IRelease* releaseInterface = dynamic_cast(object); 20 | 21 | RETURN_IF_NULL(releaseInterface); 22 | 23 | m_object = object; 24 | m_eventTarget = dynamic_cast(object); 25 | m_releaseInterface = releaseInterface; 26 | m_type = type; 27 | m_baseType = baseType; 28 | 29 | return S_OK; 30 | } 31 | 32 | virtual ~ExternalObject() 33 | { 34 | if (m_releaseInterface) { 35 | delete m_releaseInterface; 36 | m_object = nullptr; 37 | m_releaseInterface = nullptr; 38 | m_eventTarget = nullptr; 39 | } 40 | } 41 | 42 | void* getObject() { return m_object; } 43 | HoloJs::EventTarget* getEventTarget() { return m_eventTarget; } 44 | 45 | void setResourceTracker(ResourceManager* resourceTracker) { m_resourceTracker = resourceTracker; } 46 | 47 | ResourceManager* getResourceTracker() { return m_resourceTracker; } 48 | 49 | ObjectType getType() const { return m_type; } 50 | ObjectType getBaseType() const { return m_baseType; } 51 | bool hasBaseType() const { return (m_baseType != ObjectType::None); } 52 | 53 | private: 54 | void* m_object = nullptr; 55 | HoloJs::EventTarget* m_eventTarget = nullptr; 56 | IRelease* m_releaseInterface = nullptr; 57 | ObjectType m_type; 58 | ObjectType m_baseType; 59 | 60 | ResourceManager* m_resourceTracker; 61 | }; 62 | 63 | } // namespace ResourceManagement 64 | } // namespace HoloJs 65 | -------------------------------------------------------------------------------- /core/resource-management/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /core/script-loader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "include/holojs/private/app-model.h" 8 | 9 | namespace HoloJs { 10 | namespace AppModel { 11 | 12 | class ScriptsLoader { 13 | public: 14 | ScriptsLoader() {} 15 | 16 | long loadApp(const std::wstring& appUri, std::shared_ptr& scriptApp); 17 | long loadApp(void* platformHandle, std::shared_ptr& scriptApp); 18 | long createEmptyApp(std::shared_ptr& scriptApp); 19 | long loadScriptInline(const std::wstring& script, std::shared_ptr& scriptApp); 20 | void setSupportScripts(std::shared_ptr> supportScripts) { m_supportScripts = supportScripts; } 21 | 22 | long createAppFromScripts(const std::wstring& appName, 23 | std::shared_ptr> scripts, 24 | std::shared_ptr& scriptApp); 25 | 26 | static bool isAbsoluteWebUri(std::wstring appUri); 27 | 28 | private: 29 | 30 | std::shared_ptr> m_supportScripts; 31 | 32 | std::wstring getFileSystemBasePathForAppPath(const std::wstring& appPath); 33 | std::wstring getBaseUriForAppUri(const std::wstring& appUri); 34 | 35 | std::list splitPath(const std::wstring& path); 36 | }; 37 | } // namespace AppModel 38 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/scripts/2d-context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/2d-context.js -------------------------------------------------------------------------------- /core/scripts/URL.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/URL.js -------------------------------------------------------------------------------- /core/scripts/canvas-vr.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/canvas-vr.js -------------------------------------------------------------------------------- /core/scripts/canvas.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/canvas.js -------------------------------------------------------------------------------- /core/scripts/console.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/console.js -------------------------------------------------------------------------------- /core/scripts/document.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/document.js -------------------------------------------------------------------------------- /core/scripts/gamepad.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/gamepad.js -------------------------------------------------------------------------------- /core/scripts/image.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/image.js -------------------------------------------------------------------------------- /core/scripts/loading-animation.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/loading-animation.js -------------------------------------------------------------------------------- /core/scripts/spatial-anchors.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/spatial-anchors.js -------------------------------------------------------------------------------- /core/scripts/speech-recognizer.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/speech-recognizer.js -------------------------------------------------------------------------------- /core/scripts/surface-mapper.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/surface-mapper.js -------------------------------------------------------------------------------- /core/scripts/three.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/three.js -------------------------------------------------------------------------------- /core/scripts/timers.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/timers.js -------------------------------------------------------------------------------- /core/scripts/webaudio.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/webaudio.js -------------------------------------------------------------------------------- /core/scripts/webgl-context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/webgl-context.js -------------------------------------------------------------------------------- /core/scripts/websocket.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/websocket.js -------------------------------------------------------------------------------- /core/scripts/webvr.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/webvr.js -------------------------------------------------------------------------------- /core/scripts/window.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/window.js -------------------------------------------------------------------------------- /core/scripts/xmlhttprequest.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/core/scripts/xmlhttprequest.js -------------------------------------------------------------------------------- /core/spatial-anchors-projection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "include/holojs/private/chakra.h" 4 | #include "include/holojs/private/spatial-anchors.h" 5 | #include "resource-management/resource-manager.h" 6 | #include 7 | 8 | namespace HoloJs { 9 | 10 | class IHoloJsScriptHostInternal; 11 | 12 | class SpatialAnchorsProjection { 13 | public: 14 | SpatialAnchorsProjection(std::shared_ptr resourceManager, 15 | HoloJs::IHoloJsScriptHostInternal* host) 16 | : m_resourceManager(resourceManager), m_host(host) 17 | { 18 | } 19 | 20 | ~SpatialAnchorsProjection() {} 21 | 22 | long initialize(); 23 | 24 | private: 25 | JS_PROJECTION_DEFINE(SpatialAnchorsProjection, areAvailable) 26 | JS_PROJECTION_DEFINE(SpatialAnchorsProjection, canPersist) 27 | JS_PROJECTION_DEFINE(SpatialAnchorsProjection, createStore) 28 | JS_PROJECTION_DEFINE(SpatialAnchorsProjection, initializeStore) 29 | JS_PROJECTION_DEFINE(SpatialAnchorsProjection, createAnchor) 30 | JS_PROJECTION_DEFINE(SpatialAnchorsProjection, openAnchor) 31 | JS_PROJECTION_DEFINE(SpatialAnchorsProjection, saveAnchor) 32 | JS_PROJECTION_DEFINE(SpatialAnchorsProjection, deleteAnchor) 33 | JS_PROJECTION_DEFINE(SpatialAnchorsProjection, enumerateAnchors) 34 | JS_PROJECTION_DEFINE(SpatialAnchorsProjection, tryGetTransformTo) 35 | 36 | std::shared_ptr m_resourceManager; 37 | HoloJs::IHoloJsScriptHostInternal* m_host; 38 | }; 39 | 40 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/speech-recognizer-projection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "include/holojs/private/chakra.h" 4 | #include "resource-management/resource-manager.h" 5 | #include 6 | 7 | namespace HoloJs { 8 | 9 | class IHoloJsScriptHostInternal; 10 | 11 | class SpeechRecognizerProjection { 12 | public: 13 | SpeechRecognizerProjection(std::shared_ptr resourceManager, 14 | HoloJs::IHoloJsScriptHostInternal* host) 15 | : m_resourceManager(resourceManager), m_host(host) 16 | { 17 | } 18 | 19 | ~SpeechRecognizerProjection() {} 20 | 21 | void enable() { m_isEnabled = true; } 22 | void disable() { m_isEnabled = false; } 23 | 24 | long initialize(); 25 | 26 | private: 27 | JS_PROJECTION_DEFINE(SpeechRecognizerProjection, isAvailable) 28 | JS_PROJECTION_DEFINE(SpeechRecognizerProjection, create) 29 | JS_PROJECTION_DEFINE(SpeechRecognizerProjection, start) 30 | JS_PROJECTION_DEFINE(SpeechRecognizerProjection, stop) 31 | JS_PROJECTION_DEFINE(SpeechRecognizerProjection, setKeywords) 32 | JS_PROJECTION_DEFINE(SpeechRecognizerProjection, enableFreeFormDictation) 33 | 34 | std::shared_ptr m_resourceManager; 35 | HoloJs::IHoloJsScriptHostInternal* m_host; 36 | 37 | bool m_isEnabled = false; 38 | }; 39 | 40 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/surface-mapping-projection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "include/holojs/private/chakra.h" 4 | #include "resource-management/resource-manager.h" 5 | #include 6 | 7 | namespace HoloJs { 8 | 9 | class IHoloJsScriptHostInternal; 10 | 11 | class SurfaceMappingProjection { 12 | public: 13 | SurfaceMappingProjection(std::shared_ptr resourceManager, 14 | HoloJs::IHoloJsScriptHostInternal* host) 15 | : m_resourceManager(resourceManager), m_host(host) 16 | { 17 | } 18 | ~SurfaceMappingProjection() {} 19 | 20 | virtual void Release() {} 21 | 22 | long initialize(); 23 | 24 | private: 25 | JS_PROJECTION_DEFINE(SurfaceMappingProjection, isAvailable) 26 | JS_PROJECTION_DEFINE(SurfaceMappingProjection, create) 27 | JS_PROJECTION_DEFINE(SurfaceMappingProjection, start) 28 | JS_PROJECTION_DEFINE(SurfaceMappingProjection, stop) 29 | JS_PROJECTION_DEFINE(SurfaceMappingProjection, triangleDensity) 30 | JS_PROJECTION_DEFINE(SurfaceMappingProjection, boundingCube) 31 | 32 | std::shared_ptr m_resourceManager; 33 | HoloJs::IHoloJsScriptHostInternal* m_host; 34 | }; 35 | 36 | } // namespace HoloJs -------------------------------------------------------------------------------- /core/timers.cpp: -------------------------------------------------------------------------------- 1 | #include "include/holojs/private/error-handling.h" 2 | #include "include/holojs/private/script-host-utilities.h" 3 | #include "include/holojs/private/timers.h" 4 | #include "host-interfaces.h" 5 | 6 | using namespace HoloJs; 7 | 8 | HRESULT Timers::initialize() 9 | { 10 | RETURN_IF_FAILED( 11 | ScriptHostUtilities::ProjectFunction(L"setTimeout", L"timers", setTimeoutStatic, this, &m_setTimeoutFunction)); 12 | RETURN_IF_FAILED( 13 | ScriptHostUtilities::ProjectFunction(L"clearTimer", L"timers", clearTimerStatic, this, &m_clearTimerFunction)); 14 | 15 | RETURN_IF_FAILED(ScriptHostUtilities::ProjectFunction( 16 | L"setInterval", L"timers", setIntervalStatic, this, &m_setIntervalFunction)); 17 | 18 | RETURN_IF_FAILED(ScriptHostUtilities::ProjectFunction( 19 | L"clearInterval", L"timers", clearIntervalStatic, this, &m_clearIntervalFunction)); 20 | 21 | return S_OK; 22 | } -------------------------------------------------------------------------------- /core/webaudio/audio-buffer-source-projection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/holojs/private/chakra.h" 4 | #include "../resource-management/resource-manager.h" 5 | #include 6 | 7 | namespace HoloJs { 8 | 9 | namespace WebAudio { 10 | 11 | class AudioBufferSourceProjection { 12 | public: 13 | AudioBufferSourceProjection(std::shared_ptr resourceManager) 14 | : m_resourceManager(resourceManager) 15 | { 16 | } 17 | 18 | HRESULT initialize(); 19 | 20 | private: 21 | JS_PROJECTION_DEFINE(AudioBufferSourceProjection, setBuffer) 22 | JS_PROJECTION_DEFINE(AudioBufferSourceProjection, start) 23 | JS_PROJECTION_DEFINE(AudioBufferSourceProjection, stop) 24 | JS_PROJECTION_DEFINE(AudioBufferSourceProjection, getPlaybackRate) 25 | JS_PROJECTION_DEFINE(AudioBufferSourceProjection, getDetune) 26 | 27 | JS_PROJECTION_DEFINE(AudioBufferSourceProjection, getLoop) 28 | JS_PROJECTION_DEFINE(AudioBufferSourceProjection, setLoop) 29 | 30 | JS_PROJECTION_DEFINE(AudioBufferSourceProjection, getLoopStart) 31 | JS_PROJECTION_DEFINE(AudioBufferSourceProjection, setLoopStart) 32 | 33 | JS_PROJECTION_DEFINE(AudioBufferSourceProjection, getLoopEnd) 34 | JS_PROJECTION_DEFINE(AudioBufferSourceProjection, setLoopEnd) 35 | 36 | private: 37 | std::shared_ptr m_resourceManager; 38 | }; 39 | } // namespace WebAudio 40 | } // namespace HoloJs 41 | -------------------------------------------------------------------------------- /core/webaudio/audio-listener-projection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/holojs/private/chakra.h" 4 | #include "../resource-management/resource-manager.h" 5 | #include 6 | 7 | namespace HoloJs { 8 | 9 | namespace WebAudio { 10 | 11 | class AudioListenerProjection { 12 | public: 13 | AudioListenerProjection(std::shared_ptr resourceManager) 14 | : m_resourceManager(resourceManager) 15 | { 16 | } 17 | 18 | HRESULT initialize(); 19 | 20 | private: 21 | enum class AudioParamType { 22 | PositionX, 23 | PositionY, 24 | PositionZ, 25 | ForwardX, 26 | ForwardY, 27 | ForwardZ, 28 | UpX, 29 | UpY, 30 | UpZ, 31 | }; 32 | 33 | JsValueRef getParamRefByType(JsValueRef listenerRef, AudioParamType type); 34 | 35 | JS_PROJECTION_DEFINE(AudioListenerProjection, positionX) 36 | JS_PROJECTION_DEFINE(AudioListenerProjection, positionY) 37 | JS_PROJECTION_DEFINE(AudioListenerProjection, positionZ) 38 | 39 | JS_PROJECTION_DEFINE(AudioListenerProjection, forwardX) 40 | JS_PROJECTION_DEFINE(AudioListenerProjection, forwardY) 41 | JS_PROJECTION_DEFINE(AudioListenerProjection, forwardZ) 42 | 43 | JS_PROJECTION_DEFINE(AudioListenerProjection, upX) 44 | JS_PROJECTION_DEFINE(AudioListenerProjection, upY) 45 | JS_PROJECTION_DEFINE(AudioListenerProjection, upZ) 46 | 47 | JS_PROJECTION_DEFINE(AudioListenerProjection, setPosition) 48 | JS_PROJECTION_DEFINE(AudioListenerProjection, setOrientation) 49 | 50 | private: 51 | std::shared_ptr m_resourceManager; 52 | }; 53 | } // namespace WebAudio 54 | } // namespace HoloJs 55 | -------------------------------------------------------------------------------- /core/webaudio/audio-node-projection.cpp: -------------------------------------------------------------------------------- 1 | #include "audio-node-projection.h" 2 | #include "../host-interfaces.h" 3 | #include "../include/holojs/private/platform-interfaces.h" 4 | #include "../include/holojs/private/script-host-utilities.h" 5 | #include "../include/holojs/private/webaudio-interfaces.h" 6 | #include "../resource-management/resource-manager.h" 7 | 8 | using namespace HoloJs; 9 | using namespace HoloJs::ResourceManagement; 10 | using namespace HoloJs::WebAudio; 11 | using namespace std; 12 | 13 | HRESULT AudioNodeProjection::initialize() 14 | { 15 | // WebGL context projections 16 | RETURN_IF_FAILED(ScriptHostUtilities::ProjectFunction( 17 | L"audioNodeConnect", L"webaudio", connectStatic, this, &m_connectFunction)); 18 | 19 | RETURN_IF_FAILED(ScriptHostUtilities::ProjectFunction( 20 | L"audioNodeDisconnect", L"webaudio", disconnectStatic, this, &m_disconnectFunction)); 21 | 22 | return S_OK; 23 | } 24 | 25 | JsValueRef AudioNodeProjection::connect(JsValueRef* arguments, unsigned short argumentCount) 26 | { 27 | RETURN_INVALID_REF_IF_TRUE(argumentCount < 3); 28 | 29 | auto audioNode = m_resourceManager->externalToObject(arguments[1], ObjectType::IAudioNode); 30 | RETURN_INVALID_REF_IF_NULL(audioNode); 31 | 32 | auto destinationNode = m_resourceManager->externalToObject(arguments[2], ObjectType::IAudioNode); 33 | RETURN_INVALID_REF_IF_NULL(destinationNode); 34 | 35 | audioNode->connect(destinationNode); 36 | 37 | return arguments[2]; 38 | } 39 | 40 | JsValueRef AudioNodeProjection::disconnect(JsValueRef* arguments, unsigned short argumentCount) 41 | { 42 | RETURN_INVALID_REF_IF_FALSE(argumentCount == 2); 43 | 44 | auto audioNode = m_resourceManager->externalToObject(arguments[1], ObjectType::IAudioNode); 45 | RETURN_INVALID_REF_IF_NULL(audioNode); 46 | 47 | audioNode->disconnect(); 48 | 49 | return JS_INVALID_REFERENCE; 50 | } -------------------------------------------------------------------------------- /core/webaudio/audio-node-projection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/holojs/private/chakra.h" 4 | #include "../resource-management/resource-manager.h" 5 | #include 6 | 7 | namespace HoloJs { 8 | 9 | namespace WebAudio { 10 | 11 | class AudioNodeProjection { 12 | public: 13 | AudioNodeProjection(std::shared_ptr resourceManager) 14 | : m_resourceManager(resourceManager) 15 | { 16 | } 17 | 18 | HRESULT initialize(); 19 | 20 | private: 21 | std::shared_ptr m_resourceManager; 22 | 23 | JsValueRef m_connectFunction = JS_INVALID_REFERENCE; 24 | static JsValueRef CHAKRA_CALLBACK connectStatic(JsValueRef callee, 25 | bool isConstructCall, 26 | JsValueRef* arguments, 27 | unsigned short argumentCount, 28 | PVOID callbackData) 29 | { 30 | return reinterpret_cast(callbackData)->connect(arguments, argumentCount); 31 | } 32 | JsValueRef connect(JsValueRef* arguments, unsigned short argumentCount); 33 | 34 | JsValueRef m_disconnectFunction = JS_INVALID_REFERENCE; 35 | static JsValueRef CHAKRA_CALLBACK disconnectStatic(JsValueRef callee, 36 | bool isConstructCall, 37 | JsValueRef* arguments, 38 | unsigned short argumentCount, 39 | PVOID callbackData) 40 | { 41 | return reinterpret_cast(callbackData)->disconnect(arguments, argumentCount); 42 | } 43 | JsValueRef disconnect(JsValueRef* arguments, unsigned short argumentCount); 44 | }; 45 | } // namespace WebAudio 46 | } // namespace HoloJs 47 | -------------------------------------------------------------------------------- /core/webaudio/audio-param-projection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../include/holojs/private/chakra.h" 4 | #include "../resource-management/resource-manager.h" 5 | #include 6 | 7 | namespace HoloJs { 8 | 9 | namespace WebAudio { 10 | 11 | class AudioParamProjection { 12 | public: 13 | AudioParamProjection(std::shared_ptr resourceManager) 14 | : m_resourceManager(resourceManager) 15 | { 16 | } 17 | 18 | HRESULT initialize(); 19 | 20 | private: 21 | JS_PROJECTION_DEFINE(AudioParamProjection, setValueAtTime) 22 | JS_PROJECTION_DEFINE(AudioParamProjection, setTargetAtTime) 23 | 24 | JS_PROJECTION_DEFINE(AudioParamProjection, getValue) 25 | JS_PROJECTION_DEFINE(AudioParamProjection, setValue) 26 | 27 | JS_PROJECTION_DEFINE(AudioParamProjection, getDefaultValue) 28 | JS_PROJECTION_DEFINE(AudioParamProjection, getMinValue) 29 | JS_PROJECTION_DEFINE(AudioParamProjection, getMaxValue) 30 | 31 | JS_PROJECTION_DEFINE(AudioParamProjection, linearRampToValueAtTime) 32 | JS_PROJECTION_DEFINE(AudioParamProjection, exponentialRampToValueAtTime) 33 | JS_PROJECTION_DEFINE(AudioParamProjection, setValueCurveAtTime) 34 | 35 | JS_PROJECTION_DEFINE(AudioParamProjection, cancelScheduledValues) 36 | 37 | private: 38 | std::shared_ptr m_resourceManager; 39 | }; 40 | } // namespace WebAudio 41 | } // namespace HoloJs 42 | -------------------------------------------------------------------------------- /core/websocket-projection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "include/holojs/private/chakra.h" 4 | #include "resource-management/resource-manager.h" 5 | #include 6 | 7 | namespace HoloJs { 8 | 9 | class IHoloJsScriptHostInternal; 10 | 11 | class WebSocketProjection { 12 | public: 13 | WebSocketProjection(std::shared_ptr resourceManager, 14 | HoloJs::IHoloJsScriptHostInternal* host) 15 | : m_resourceManager(resourceManager), m_host(host) 16 | { 17 | } 18 | ~WebSocketProjection() {} 19 | 20 | virtual void Release() {} 21 | 22 | long initialize(); 23 | 24 | private: 25 | JS_PROJECTION_DEFINE(WebSocketProjection, create) 26 | JS_PROJECTION_DEFINE(WebSocketProjection, close) 27 | JS_PROJECTION_DEFINE(WebSocketProjection, send) 28 | JS_PROJECTION_DEFINE(WebSocketProjection, binaryType) 29 | JS_PROJECTION_DEFINE(WebSocketProjection, readyState) 30 | JS_PROJECTION_DEFINE(WebSocketProjection, bufferedAmount) 31 | 32 | std::shared_ptr m_resourceManager; 33 | HoloJs::IHoloJsScriptHostInternal* m_host; 34 | }; 35 | 36 | } // namespace HoloJs -------------------------------------------------------------------------------- /docs/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: 'Segoe UI', Helvetica, Tahoma, Verdana, sans-serif 3 | } 4 | 5 | .content { 6 | line-height: 1.75em; 7 | margin: auto; 8 | max-width: 800px; 9 | margin-left: 320px; 10 | } 11 | 12 | h1 { 13 | color: maroon; 14 | } 15 | 16 | .bold { 17 | font-weight: bolder 18 | } 19 | 20 | .note { 21 | margin: 20px; 22 | border-left: solid #666666 5px; 23 | padding-left: 5px; 24 | } 25 | 26 | .code { 27 | font-style: italic; 28 | color: #222222; 29 | background: #f4f4f4; 30 | } 31 | 32 | .index { 33 | float: left; 34 | width: 300px; 35 | } -------------------------------------------------------------------------------- /docs/img/add-holojs-package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/add-holojs-package.png -------------------------------------------------------------------------------- /docs/img/app-json-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/app-json-file.png -------------------------------------------------------------------------------- /docs/img/ballshooter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/ballshooter.png -------------------------------------------------------------------------------- /docs/img/ballshooter_qr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/ballshooter_qr.png -------------------------------------------------------------------------------- /docs/img/breakpoint-sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/breakpoint-sample.png -------------------------------------------------------------------------------- /docs/img/cloth-physics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/cloth-physics.png -------------------------------------------------------------------------------- /docs/img/debug-buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/debug-buttons.png -------------------------------------------------------------------------------- /docs/img/directional-sound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/directional-sound.png -------------------------------------------------------------------------------- /docs/img/embedded-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/embedded-preview.png -------------------------------------------------------------------------------- /docs/img/faulty-breakpoints.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/faulty-breakpoints.png -------------------------------------------------------------------------------- /docs/img/install-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/install-error.png -------------------------------------------------------------------------------- /docs/img/loaded-scripts-collapsed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/loaded-scripts-collapsed.png -------------------------------------------------------------------------------- /docs/img/loaded-scripts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/loaded-scripts.png -------------------------------------------------------------------------------- /docs/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/logo.png -------------------------------------------------------------------------------- /docs/img/molecule-viewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/molecule-viewer.png -------------------------------------------------------------------------------- /docs/img/moleculeviewer-qr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/moleculeviewer-qr.png -------------------------------------------------------------------------------- /docs/img/new-console-application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/new-console-application.png -------------------------------------------------------------------------------- /docs/img/new-uwp-application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/new-uwp-application.png -------------------------------------------------------------------------------- /docs/img/scripts-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/scripts-list.png -------------------------------------------------------------------------------- /docs/img/select-nodejs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/select-nodejs.png -------------------------------------------------------------------------------- /docs/img/spin-make-demo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/spin-make-demo.mp4 -------------------------------------------------------------------------------- /docs/img/surface-mapping.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/surface-mapping.jpg -------------------------------------------------------------------------------- /docs/img/surfacemapping-qr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/surfacemapping-qr.png -------------------------------------------------------------------------------- /docs/img/uwp-package-content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/uwp-package-content.png -------------------------------------------------------------------------------- /docs/img/vr-cubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/vr-cubes.png -------------------------------------------------------------------------------- /docs/img/vr-paint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/vr-paint.jpg -------------------------------------------------------------------------------- /docs/img/vr-paint.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/vr-paint.mp4 -------------------------------------------------------------------------------- /docs/img/vrcubes-qr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/vrcubes-qr.png -------------------------------------------------------------------------------- /docs/img/vrpaint-qr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/vrpaint-qr.png -------------------------------------------------------------------------------- /docs/img/vs-add-existing-item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/vs-add-existing-item.png -------------------------------------------------------------------------------- /docs/img/vs-code-add-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/vs-code-add-config.png -------------------------------------------------------------------------------- /docs/img/vs-debug-properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/vs-debug-properties.png -------------------------------------------------------------------------------- /docs/img/vs-loaded-scripts-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/vs-loaded-scripts-list.png -------------------------------------------------------------------------------- /docs/img/vs-new-filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/vs-new-filter.png -------------------------------------------------------------------------------- /docs/img/vs-project-properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/vs-project-properties.png -------------------------------------------------------------------------------- /docs/img/win32-cubes-vr.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/win32-cubes-vr.mp4 -------------------------------------------------------------------------------- /docs/img/win32-cubes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/img/win32-cubes.png -------------------------------------------------------------------------------- /docs/privacy-policy-viewer.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | Privacy Policy for Spin View 4 | 5 |
6 | 7 |

Privacy Policy for Spin View

8 | We don't collect, store or share personal identifiable data. We don't collect telemtry, crash data or any other non personal identifiable data. There is no server, web service or database to store data.

9 | Spin View does not store a history of 3D experiences it ran. Spin View does not provide any facility to store data locally.

10 | Spin View has no control over the third party VR and AR experiences you run in it. Be cautious when running experiences from web locations you don't trust as they can access your microphone and, if running on the HoloLens, the 3D model of your environment. 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/privacy-policy.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | Privacy Policy for Spin Make 4 | 5 |
6 | 7 |

Privacy Policy for Spin Make

8 | We don't collect, store or share personal identifiable data. We don't collect telemtry, crash data or any other non personal identifiable data. There is no server, web service or database to store data. 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/samples/ballshooter.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/samples/ballshooter.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": [ "threejs/three.js", "threejs/control/OrbitControls.js", "threejs/geometries/BoxLineGeometry.js", "appcode/ballshooter.js" ], 3 | "resources": [], 4 | "name": "", 5 | "HtmlAppName": "ballshooter.html", 6 | "XsrFileName": "ballshooter.xrs" 7 | } -------------------------------------------------------------------------------- /docs/samples/bouncing-sound.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": [ "threejs/three.js", "threejs/control/OrbitControls.js", "appcode/bouncing-sound.js" ], 3 | "resources": [ "media/sounds/ping_pong.mp3" ], 4 | "name": "", 5 | "HtmlAppName": "bouncing-sound.html" 6 | } -------------------------------------------------------------------------------- /docs/samples/cloth-physics.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/samples/cloth-physics.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": [ "threejs/three.js", "physics/ammo.js", "threejs/control/OrbitControls.js", "appcode/cloth-physics.js" ], 3 | "resources": [ "media/images/grid.png" ], 4 | "name": "", 5 | "HtmlAppName": "cloth-physics.html", 6 | "XsrFileName": "cloth-physics.xrs" 7 | } -------------------------------------------------------------------------------- /docs/samples/controller-view.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": [ "threejs/three.js", "threejs/VRController.js", "threejs/datguivr.js", "appcode/controller-view.js" ], 3 | "resources": [], 4 | "name": "controller test app", 5 | "XsrFileName": "controller-view.json" 6 | } -------------------------------------------------------------------------------- /docs/samples/convex-break.json: -------------------------------------------------------------------------------- 1 | { "scripts": [ "threejs/three.js", "threejs/loaders/OBJLoader.js", "physics/ammo.js", "threejs/control/OrbitControls.js", "threejs/ConvexObjectBreaker.js", "threejs/QuickHull.js", "threejs/geometries/ConvexGeometry.js", "appcode/convex-break.js" ] } -------------------------------------------------------------------------------- /docs/samples/directional-sound.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/samples/directional-sound.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": [ "threejs/three.js", "threejs/control/OrbitControls.js", "threejs/loaders/GLTFLoader.js", "appcode/directional-sound.js" ], 3 | "resources": [ "media/sounds/376737_Skullbeatz___Bad_Cat_Maste.mp3", "media/models/gltf/BoomBox.glb", "media/textures/cube/SwedishRoyalCastle/nx.jpg", "media/textures/cube/SwedishRoyalCastle/ny.jpg", "media/textures/cube/SwedishRoyalCastle/nz.jpg", "media/textures/cube/SwedishRoyalCastle/px.jpg", "media/textures/cube/SwedishRoyalCastle/py.jpg", "media/textures/cube/SwedishRoyalCastle/pz.jpg" ], 4 | "name": "Directional sound demo", 5 | "HtmlAppName": "directional-sound.html", 6 | "XsrFileName": "directional-sound.xrs" 7 | } -------------------------------------------------------------------------------- /docs/samples/hololens-surface-mapping.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": [ "threejs/three.js", "appcode/hololens-surface-mapping.js" ], 3 | "resources": [], 4 | "name": "", 5 | "HtmlAppName": "hololens-surface-mapping.html", 6 | "XsrFileName": "hololens-surface-mapping.xrs" 7 | } -------------------------------------------------------------------------------- /docs/samples/lorenz-attractor.json: -------------------------------------------------------------------------------- 1 | { "scripts": [ "threejs/three.js", "threejs/control/OrbitControls.js", "threejs/geometries/BoxLineGeometry.js", "appcode/lorenz-attractor.js" ] } -------------------------------------------------------------------------------- /docs/samples/media/images/arrow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/images/arrow.jpg -------------------------------------------------------------------------------- /docs/samples/media/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/images/arrow.png -------------------------------------------------------------------------------- /docs/samples/media/images/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/images/grid.png -------------------------------------------------------------------------------- /docs/samples/media/images/onepointfive_spec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/images/onepointfive_spec.png -------------------------------------------------------------------------------- /docs/samples/media/images/onepointfive_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/images/onepointfive_texture.png -------------------------------------------------------------------------------- /docs/samples/media/models/gltf/BoomBox.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/models/gltf/BoomBox.glb -------------------------------------------------------------------------------- /docs/samples/media/models/vive-controller/onepointfive_spec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/models/vive-controller/onepointfive_spec.png -------------------------------------------------------------------------------- /docs/samples/media/models/vive-controller/onepointfive_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/models/vive-controller/onepointfive_texture.png -------------------------------------------------------------------------------- /docs/samples/media/sounds/376737_Skullbeatz___Bad_Cat_Maste.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/sounds/376737_Skullbeatz___Bad_Cat_Maste.mp3 -------------------------------------------------------------------------------- /docs/samples/media/sounds/ogg_sample.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/sounds/ogg_sample.ogg -------------------------------------------------------------------------------- /docs/samples/media/sounds/ping_pong.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/sounds/ping_pong.mp3 -------------------------------------------------------------------------------- /docs/samples/media/textures/cube/SwedishRoyalCastle/nx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/textures/cube/SwedishRoyalCastle/nx.jpg -------------------------------------------------------------------------------- /docs/samples/media/textures/cube/SwedishRoyalCastle/ny.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/textures/cube/SwedishRoyalCastle/ny.jpg -------------------------------------------------------------------------------- /docs/samples/media/textures/cube/SwedishRoyalCastle/nz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/textures/cube/SwedishRoyalCastle/nz.jpg -------------------------------------------------------------------------------- /docs/samples/media/textures/cube/SwedishRoyalCastle/px.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/textures/cube/SwedishRoyalCastle/px.jpg -------------------------------------------------------------------------------- /docs/samples/media/textures/cube/SwedishRoyalCastle/py.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/textures/cube/SwedishRoyalCastle/py.jpg -------------------------------------------------------------------------------- /docs/samples/media/textures/cube/SwedishRoyalCastle/pz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/media/textures/cube/SwedishRoyalCastle/pz.jpg -------------------------------------------------------------------------------- /docs/samples/molecule-viewer.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/samples/molecule-viewer.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": [ "threejs/three.js", "threejs/loaders/PDBLoader.js", "appcode/molecule-viewer.js" ], 3 | "resources": [ "media/models/caffeine.pdb" ], 4 | "name": "", 5 | "HtmlAppName": "molecule-viewer.html", 6 | "XsrFileName": "molecule-viewer.xrs" 7 | } -------------------------------------------------------------------------------- /docs/samples/threejs/geometries/ConvexGeometry.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Mugen87 / https://github.com/Mugen87 3 | */ 4 | 5 | ( function () { 6 | 7 | // ConvexGeometry 8 | 9 | function ConvexGeometry( points ) { 10 | 11 | THREE.Geometry.call( this ); 12 | 13 | this.fromBufferGeometry( new ConvexBufferGeometry( points ) ); 14 | this.mergeVertices(); 15 | 16 | } 17 | 18 | ConvexGeometry.prototype = Object.create( THREE.Geometry.prototype ); 19 | ConvexGeometry.prototype.constructor = ConvexGeometry; 20 | 21 | // ConvexBufferGeometry 22 | 23 | function ConvexBufferGeometry( points ) { 24 | 25 | THREE.BufferGeometry.call( this ); 26 | 27 | // buffers 28 | 29 | var vertices = []; 30 | var normals = []; 31 | 32 | // execute QuickHull 33 | 34 | if ( THREE.QuickHull === undefined ) { 35 | 36 | console.error( 'THREE.ConvexBufferGeometry: ConvexBufferGeometry relies on THREE.QuickHull' ); 37 | 38 | } 39 | 40 | var quickHull = new THREE.QuickHull().setFromPoints( points ); 41 | 42 | // generate vertices and normals 43 | 44 | var faces = quickHull.faces; 45 | 46 | for ( var i = 0; i < faces.length; i ++ ) { 47 | 48 | var face = faces[ i ]; 49 | var edge = face.edge; 50 | 51 | // we move along a doubly-connected edge list to access all face points (see HalfEdge docs) 52 | 53 | do { 54 | 55 | var point = edge.head().point; 56 | 57 | vertices.push( point.x, point.y, point.z ); 58 | normals.push( face.normal.x, face.normal.y, face.normal.z ); 59 | 60 | edge = edge.next; 61 | 62 | } while ( edge !== face.edge ); 63 | 64 | } 65 | 66 | // build geometry 67 | 68 | this.addAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) ); 69 | this.addAttribute( 'normal', new THREE.Float32BufferAttribute( normals, 3 ) ); 70 | 71 | } 72 | 73 | ConvexBufferGeometry.prototype = Object.create( THREE.BufferGeometry.prototype ); 74 | ConvexBufferGeometry.prototype.constructor = ConvexBufferGeometry; 75 | 76 | // export 77 | 78 | THREE.ConvexGeometry = ConvexGeometry; 79 | THREE.ConvexBufferGeometry = ConvexBufferGeometry; 80 | 81 | } )(); 82 | -------------------------------------------------------------------------------- /docs/samples/uwp-embeded-sample/HoloJsApp.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/docs/samples/uwp-embeded-sample/HoloJsApp.zip -------------------------------------------------------------------------------- /docs/samples/uwp-embeded-sample/holojs-app.js: -------------------------------------------------------------------------------- 1 | var camera, scene, renderer; 2 | 3 | function init() { 4 | let canvas = document.createElement('canvasvr'); 5 | 6 | renderer = new THREE.WebGLRenderer({ canvas, antialias: true }); 7 | renderer.setPixelRatio(window.devicePixelRatio); 8 | renderer.setSize(window.innerWidth, window.innerHeight); 9 | renderer.setAnimationLoop(render); 10 | 11 | window.addEventListener('resize', onWindowResize, false); 12 | 13 | camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.2, 1000); 14 | camera.position.set(0, 1, 0); 15 | 16 | scene = new THREE.Scene(); 17 | 18 | let geometry = new THREE.BoxBufferGeometry(0.3, 0.3, 0.3); 19 | let material = new THREE.MeshBasicMaterial({ color : 0xff0000 }); 20 | let cube = new THREE.Mesh(geometry, material); 21 | cube.position.z = -1.5; 22 | cube.position.y = 1.6; 23 | scene.add(cube); 24 | 25 | // Enter immersive mode if available 26 | navigator.getVRDisplays().then( 27 | function (value) { 28 | if (value.length > 0) { 29 | renderer.vr.enabled = true; 30 | renderer.vr.setDevice(value[0]); 31 | value[0].requestPresent([{ source: renderer.domElement }]); 32 | } 33 | }); 34 | } 35 | 36 | function onWindowResize() { 37 | camera.aspect = window.innerWidth / window.innerHeight; 38 | camera.updateProjectionMatrix(); 39 | renderer.setSize(window.innerWidth, window.innerHeight); 40 | } 41 | 42 | function render() { 43 | renderer.render(scene, camera); 44 | } 45 | 46 | init(); -------------------------------------------------------------------------------- /docs/samples/uwp-embeded-sample/holojs-app.json: -------------------------------------------------------------------------------- 1 | {"scripts":["three.js","holojs-app.js"],"resources":[],"name":"","XsrFileName":"holojs-app.json"} -------------------------------------------------------------------------------- /docs/samples/vr-cubes.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/samples/vr-cubes.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": [ "threejs/three.js", "threejs/control/OrbitControls.js", "threejs/geometries/BoxLineGeometry.js", "appcode/vr-cubes.js" ], 3 | "resources": [], 4 | "name": "VR cubes", 5 | "HtmlAppName": "vr-cubes.html" 6 | } -------------------------------------------------------------------------------- /docs/samples/vr-paint.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/samples/vr-paint.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": [ "threejs/three.js", "threejs/loaders/OBJLoader.js", "appcode/vr-paint.js" ], 3 | "resources": [ "media/models/vive-controller/onepointfive_spec.png", "media/models/vive-controller/onepointfive_texture.png", "media/models/vive-controller/vr_controller_vive_1_5.obj" ], 4 | "name": "VR paint", 5 | "HtmlAppName": "vr-paint.html", 6 | "XsrFileName": "vr-paint.xrs" 7 | } -------------------------------------------------------------------------------- /holojs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/holojs.png -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Microsoft Corporation 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 13 | all 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 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /media/holojs.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/media/holojs.ico -------------------------------------------------------------------------------- /media/holojs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/media/holojs.png -------------------------------------------------------------------------------- /windows/nuget-package-spec/holojs.props: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | ;%(PreprocessorDefinitions) 7 | $(MSBuildThisFileDirectory)..\..\lib\native\include\;%(AdditionalIncludeDirectories) 8 | 9 | 10 | $(MSBuildThisFileDirectory);%(AdditionalLibraryDirectories) 11 | $(Platform)\libholojs-native.lib;%(AdditionalDependencies) 12 | 13 | 14 | -------------------------------------------------------------------------------- /windows/nuget-package-spec/holojs.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | x86 5 | $(Platform) 6 | 7 | 8 | 9 | 10 | %(FileName)%(Extension) 11 | PreserveNewest 12 | 13 | 14 | 15 | 16 | libholojs-uwp.dll 17 | 18 | 19 | 20 | 21 | 22 | HoloJs.UWP\ 23 | 24 | 25 | -------------------------------------------------------------------------------- /windows/nuget-package-spec/nuget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/nuget-package-spec/nuget.exe -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/App.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | // The main function is only used to initialize our IFrameworkView class. 4 | [Platform::MTAThread] 5 | int main(Platform::Array^) 6 | { 7 | auto scriptHost = ref new HoloJs::UWP::HoloJsScriptHost(); 8 | auto viewConfiguration = ref new HoloJs::UWP::ViewConfiguration(); 9 | if (scriptHost->initialize(viewConfiguration)) { 10 | auto uri = ref new Platform::String(L"http://holojs.azurewebsites.net/v7/ballshooter.xrs"); 11 | scriptHost->startUri(uri); 12 | } 13 | return 0; 14 | } -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/nuget/test-apps/uwp-app/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/nuget/test-apps/uwp-app/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/nuget/test-apps/uwp-app/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/nuget/test-apps/uwp-app/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/nuget/test-apps/uwp-app/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/nuget/test-apps/uwp-app/Assets/StoreLogo.png -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/nuget/test-apps/uwp-app/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | uwp-app 18 | Cristi 19 | Assets\StoreLogo.png 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include -------------------------------------------------------------------------------- /windows/nuget/test-apps/uwp-app/uwp-app.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 179605a6-198e-47c5-9007-1de4149810c9 6 | bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png 7 | 8 | 9 | Assets 10 | 11 | 12 | Assets 13 | 14 | 15 | Assets 16 | 17 | 18 | Assets 19 | 20 | 21 | Assets 22 | 23 | 24 | Assets 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Assets 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /windows/nuget/test-apps/win32-app/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /windows/nuget/test-apps/win32-app/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: source file corresponding to pre-compiled header; necessary for compilation to succeed 2 | 3 | #include "pch.h" 4 | 5 | // In general, ignore this file, but keep it around if you are using pre-compiled headers. 6 | -------------------------------------------------------------------------------- /windows/nuget/test-apps/win32-app/pch.h: -------------------------------------------------------------------------------- 1 | // Tips for Getting Started: 2 | // 1. Use the Solution Explorer window to add/manage files 3 | // 2. Use the Team Explorer window to connect to source control 4 | // 3. Use the Output window to see build output and other messages 5 | // 4. Use the Error List window to view errors 6 | // 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project 7 | // 6. In the future, to open this project again, go to File > Open > Project and select the .sln file 8 | 9 | #ifndef PCH_H 10 | #define PCH_H 11 | 12 | // TODO: add headers that you want to pre-compile here 13 | 14 | #endif //PCH_H 15 | -------------------------------------------------------------------------------- /windows/nuget/test-apps/win32-app/win32-app.cpp: -------------------------------------------------------------------------------- 1 | // win32-app.cpp : This file contains the 'main' function. Program execution begins and ends there. 2 | // 3 | 4 | #include "pch.h" 5 | #include 6 | #include 7 | #include "holojs/holojs.h" 8 | 9 | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) 10 | { 11 | std::shared_ptr scriptHost(HoloJs::CreateHoloJsScriptHost(), 12 | &HoloJs::DeleteHoloJsScriptHost); 13 | auto configuration = HoloJs::ViewConfiguration(); 14 | scriptHost->initialize(configuration); 15 | scriptHost->startUri(L"http://holojs.azurewebsites.net/v7/vr-cubes.xrs"); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /windows/nuget/test-apps/win32-app/win32-app.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;ipp;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 | Header Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /windows/src/common-lib/audio-buffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "holojs/private/webaudio-interfaces.h" 3 | #include "LabSound/extended/LabSound.h" 4 | 5 | namespace HoloJs { 6 | 7 | 8 | namespace Win32 { 9 | 10 | namespace WebAudio { 11 | 12 | class AudioBuffer : public HoloJs::IAudioBuffer { 13 | public: 14 | AudioBuffer(std::shared_ptr bus) : m_bus(bus) {} 15 | 16 | virtual ~AudioBuffer() {} 17 | 18 | virtual void Release() {} 19 | 20 | std::shared_ptr getBus() { return m_bus; } 21 | 22 | private: 23 | std::shared_ptr m_bus; 24 | }; 25 | } // namespace WebAudio 26 | } // namespace Win32 27 | } // namespace HoloJs -------------------------------------------------------------------------------- /windows/src/common-lib/audio-context.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "LabSound/extended/LabSound.h" 4 | #include "holojs/private/chakra.h" 5 | #include "holojs/private/event-target.h" 6 | #include "holojs/private/holojs-script-host-internal.h" 7 | #include "holojs/private/object-lifetime.h" 8 | #include "holojs/private/webaudio-interfaces.h" 9 | #include 10 | 11 | namespace HoloJs { 12 | 13 | class HoloJsScriptHost; 14 | 15 | namespace Win32 { 16 | 17 | namespace WebAudio { 18 | 19 | class AudioContext : public HoloJs::IAudioContext { 20 | public: 21 | AudioContext(HoloJs::IHoloJsScriptHostInternal* host) 22 | : m_host(host) 23 | { 24 | m_context = lab::MakeRealtimeAudioContext(2); 25 | } 26 | 27 | virtual ~AudioContext(); 28 | 29 | virtual void Release() { } 30 | 31 | virtual IGainNode* createGain(); 32 | virtual IAudioDestinationNode* getDestination(); 33 | virtual IPannerNode* createPanner(); 34 | virtual IAudioListener* getListener(); 35 | virtual IAudioBufferSource* createAudioBufferSource(); 36 | 37 | virtual long decodeAudioData(JsValueRef data, JsValueRef onSuccessCallback, JsValueRef onFailedCallback); 38 | 39 | virtual float getSampleRate() { return m_context->sampleRate(); } 40 | virtual double getCurrentTime() { return m_context->currentTime(); } 41 | 42 | private: 43 | HoloJs::IHoloJsScriptHostInternal* m_host; 44 | 45 | std::shared_ptr m_context; 46 | }; 47 | } // namespace WebAudio 48 | } // namespace Win32 49 | } // namespace HoloJs -------------------------------------------------------------------------------- /windows/src/common-lib/audio-destination-node.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "audio-node.h" 4 | #include "holojs/private/chakra.h" 5 | #include "holojs/private/event-target.h" 6 | #include "holojs/private/holojs-view.h" 7 | #include "holojs/private/object-lifetime.h" 8 | #include "holojs/private/webaudio-interfaces.h" 9 | 10 | namespace HoloJs { 11 | 12 | class HoloJsScriptHost; 13 | 14 | namespace Win32 { 15 | 16 | namespace WebAudio { 17 | 18 | class AudioDestinationNode : public HoloJs::IAudioDestinationNode, public AudioNode { 19 | public: 20 | AudioDestinationNode(std::shared_ptr context, 21 | std::shared_ptr audioDestinationNode) 22 | : m_context(context), m_audioDestinationNode(audioDestinationNode), AudioNode(context, audioDestinationNode) 23 | { 24 | } 25 | 26 | virtual ~AudioDestinationNode() { OutputDebugString(L"D"); } 27 | 28 | virtual void Release() { } 29 | 30 | virtual JsValueRef connect(IAudioNode* destination) { return AudioNode::audioNodeConnect(destination); } 31 | 32 | virtual JsValueRef disconnect() { return AudioNode::audioNodeDisconnect(); } 33 | 34 | private: 35 | std::shared_ptr m_context; 36 | std::shared_ptr m_audioDestinationNode; 37 | }; 38 | } // namespace WebAudio 39 | } // namespace Win32 40 | } // namespace HoloJs -------------------------------------------------------------------------------- /windows/src/common-lib/audio-node.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "LabSound/extended/LabSound.h" 4 | #include "holojs/private/chakra.h" 5 | #include "holojs/private/error-handling.h" 6 | #include "holojs/private/object-lifetime.h" 7 | #include "holojs/private/webaudio-interfaces.h" 8 | 9 | namespace HoloJs { 10 | 11 | class HoloJsScriptHost; 12 | 13 | namespace Win32 { 14 | 15 | namespace WebAudio { 16 | 17 | class AudioNode { 18 | public: 19 | AudioNode(std::shared_ptr context, std::shared_ptr node) 20 | : m_node(node), m_context(context) 21 | { 22 | } 23 | 24 | virtual ~AudioNode() { lab::ContextRenderLock r(m_context.get(), "delete node"); } 25 | 26 | JsValueRef audioNodeConnect(IAudioNode* destination) 27 | { 28 | auto other = dynamic_cast(destination); 29 | RETURN_INVALID_REF_IF_NULL(other); 30 | m_context->connect(other->m_node, m_node, 0, 0); 31 | 32 | return JS_INVALID_REFERENCE; 33 | } 34 | 35 | JsValueRef audioNodeDisconnect() { return JS_INVALID_REFERENCE; } 36 | 37 | private: 38 | std::shared_ptr m_context; 39 | std::shared_ptr m_node; 40 | }; 41 | } // namespace WebAudio 42 | } // namespace Win32 43 | } // namespace HoloJs -------------------------------------------------------------------------------- /windows/src/common-lib/gain-node.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "LabSound/extended/LabSound.h" 4 | #include "audio-node.h" 5 | #include "holojs/private/chakra.h" 6 | #include "holojs/private/object-lifetime.h" 7 | #include "holojs/private/webaudio-interfaces.h" 8 | 9 | namespace HoloJs { 10 | 11 | class HoloJsScriptHost; 12 | 13 | namespace Win32 { 14 | 15 | namespace WebAudio { 16 | 17 | class GainNode : public AudioNode, public IGainNode { 18 | public: 19 | GainNode(std::shared_ptr context, std::shared_ptr gainNode) 20 | : m_context(context), m_gainNode(gainNode), AudioNode(context, gainNode) 21 | { 22 | } 23 | 24 | virtual ~GainNode() { } 25 | 26 | virtual void Release() {} 27 | 28 | virtual JsValueRef connect(IAudioNode* destination) 29 | { 30 | return AudioNode::audioNodeConnect(destination); 31 | } 32 | virtual JsValueRef disconnect() { return AudioNode::audioNodeDisconnect(); } 33 | 34 | private: 35 | std::shared_ptr m_context; 36 | std::shared_ptr m_gainNode; 37 | }; 38 | } // namespace WebAudio 39 | } // namespace Win32 40 | } // namespace HoloJs -------------------------------------------------------------------------------- /windows/src/common-lib/include/holojs/windows/IBufferOnMemory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace HoloJs { 8 | 9 | class BufferOnMemory : public Microsoft::WRL::RuntimeClass< 10 | Microsoft::WRL::RuntimeClassFlags, 11 | ABI::Windows::Storage::Streams::IBuffer, 12 | Windows::Storage::Streams::IBufferByteAccess> { 13 | public: 14 | virtual ~BufferOnMemory() {} 15 | 16 | STDMETHODIMP RuntimeClassInitialize(byte *buffer, UINT totalSize) 17 | { 18 | m_length = totalSize; 19 | m_buffer = buffer; 20 | 21 | return S_OK; 22 | } 23 | 24 | STDMETHODIMP Buffer(byte **value) 25 | { 26 | *value = m_buffer; 27 | 28 | return S_OK; 29 | } 30 | 31 | STDMETHODIMP get_Capacity(UINT32 *value) 32 | { 33 | *value = m_length; 34 | 35 | return S_OK; 36 | } 37 | 38 | STDMETHODIMP get_Length(UINT32 *value) 39 | { 40 | *value = m_length; 41 | 42 | return S_OK; 43 | } 44 | 45 | STDMETHODIMP put_Length(UINT32 value) 46 | { 47 | m_length = value; 48 | 49 | return S_OK; 50 | } 51 | 52 | private: 53 | UINT32 m_length; 54 | byte *m_buffer; 55 | }; 56 | } // namespace HoloJs -------------------------------------------------------------------------------- /windows/src/common-lib/include/holojs/windows/image-data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "holojs/private/image-interface.h" 4 | #include 5 | 6 | namespace HoloJs { 7 | 8 | class HoloJsScriptHost; 9 | 10 | namespace Win32 { 11 | 12 | class WindowsImageData : public HoloJs::IImageData { 13 | public: 14 | WindowsImageData(IWICBitmapLock* bitmapLock, IMAGE_FORMAT_GUID imageFormat) 15 | { 16 | m_bitmapLock.Attach(bitmapLock); 17 | m_bitmapLock->GetStride(&m_stride); 18 | m_bitmapLock->GetDataPointer(&m_pixelsSize, &m_pixels); 19 | m_decodedFormat = imageFormat; 20 | } 21 | 22 | virtual ~WindowsImageData() { m_bitmapLock.ReleaseAndGetAddressOf(); } 23 | 24 | private: 25 | Microsoft::WRL::ComPtr m_bitmapLock; 26 | }; 27 | } // namespace Win32 28 | } // namespace HoloJs -------------------------------------------------------------------------------- /windows/src/common-lib/include/holojs/windows/mixed-reality/spatial-controller.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "holojs/private/chakra.h" 4 | #include 5 | #include 6 | 7 | namespace HoloJs { 8 | namespace MixedReality { 9 | namespace Input { 10 | 11 | class SpatialController { 12 | public: 13 | SpatialController(Windows::UI::Input::Spatial::SpatialInteractionSource ^ source, unsigned int index); 14 | ~SpatialController(); 15 | 16 | HRESULT projectToScript(); 17 | 18 | HRESULT update(Windows::UI::Input::Spatial::SpatialInteractionSourceState ^ state, 19 | Windows::UI::Input::Spatial::SpatialInteractionSourceLocation ^ location); 20 | 21 | JsValueRef getScriptControllerObject() { return m_scriptController; } 22 | 23 | private: 24 | Windows::UI::Input::Spatial::SpatialInteractionController ^ m_controller; 25 | Windows::UI::Input::Spatial::SpatialInteractionSource ^ m_source; 26 | 27 | unsigned short m_productId; 28 | std::wstring m_handedness; 29 | unsigned int m_index; 30 | 31 | JsValueRef m_scriptController = JS_INVALID_REFERENCE; 32 | JsValueRef m_scriptPose = JS_INVALID_REFERENCE; 33 | std::vector m_scriptButtons; 34 | double* m_axisBuffer; 35 | 36 | HRESULT createPoseProperty(); 37 | 38 | HRESULT createButtonsArray(); 39 | 40 | float* m_orientationVectorStoragePointer = nullptr; 41 | float* m_positionVectorStoragePointer = nullptr; 42 | 43 | JsValueRef m_orientationRef = JS_INVALID_REFERENCE; 44 | 45 | float* m_angularVelocityStoragePointer = nullptr; 46 | float* m_linearVelocityStoragePointer = nullptr; 47 | double* m_axesStoragePointer = nullptr; 48 | 49 | bool m_hadOrientationPreviously = false; 50 | bool m_hadPositionPreviously = false; 51 | }; 52 | 53 | } // namespace Input 54 | } // namespace MixedReality 55 | } // namespace HoloJs 56 | -------------------------------------------------------------------------------- /windows/src/common-lib/include/holojs/windows/performance-tracker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace HoloJs { 6 | class PerformaceTracker { 7 | public: 8 | PerformaceTracker(PCWSTR metricName, unsigned int threshold) : m_metricName(metricName), m_threshold(threshold) 9 | { 10 | QueryPerformanceFrequency(&m_timerFrequencyPerMs); 11 | m_timerFrequencyPerMs.QuadPart /= 1000; 12 | } 13 | 14 | inline void start() 15 | { 16 | #ifdef _DEBUG 17 | QueryPerformanceCounter(&m_startTimestamp); 18 | #endif 19 | } 20 | 21 | inline void end() 22 | { 23 | #ifdef _DEBUG 24 | if (m_startTimestamp.QuadPart == 0) { 25 | return; 26 | } 27 | 28 | LARGE_INTEGER endTimestamp; 29 | QueryPerformanceCounter(&endTimestamp); 30 | 31 | const auto elapsed = (endTimestamp.QuadPart - m_startTimestamp.QuadPart) / m_timerFrequencyPerMs.QuadPart; 32 | 33 | if (elapsed > m_threshold) { 34 | m_message = m_metricName; 35 | m_message.append(L" : "); 36 | m_message.append(std::to_wstring(elapsed)); 37 | m_message.append(L"\r\n"); 38 | 39 | OutputDebugString(m_message.c_str()); 40 | } 41 | #endif 42 | } 43 | 44 | private: 45 | LARGE_INTEGER m_startTimestamp; 46 | LARGE_INTEGER m_timerFrequencyPerMs; 47 | 48 | std::wstring m_metricName; 49 | std::wstring m_message; 50 | unsigned int m_threshold; 51 | }; 52 | } // namespace HoloJs 53 | -------------------------------------------------------------------------------- /windows/src/common-lib/include/holojs/windows/qr-scanner.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "holojs/private/holojs-script-host-internal.h" 4 | #include 5 | #include 6 | #include 7 | 8 | namespace HoloJs { 9 | namespace Platforms { 10 | namespace Win32 { 11 | class QrScanner { 12 | public: 13 | QrScanner(HoloJs::IHoloJsScriptHostInternal* host) : m_host(host) {} 14 | ~QrScanner() 15 | { 16 | // TODO: better way of cancelling an asynchronously running scan task 17 | while (m_isBusy) Sleep(15); 18 | } 19 | 20 | HRESULT tryDecode(); 21 | 22 | void setOnResultsCallback(std::function callback) { m_callback = callback; } 23 | 24 | private: 25 | std::function m_callback; 26 | bool m_isBusy = false; 27 | 28 | HoloJs::IHoloJsScriptHostInternal* m_host; 29 | 30 | Windows::Media::MediaProperties::ImageEncodingProperties ^ 31 | getEncodingProperties(Platform::Agile mediaCapture); 32 | 33 | HRESULT readCaptureStreamAndGetBytes(Windows::Storage::Streams::InMemoryRandomAccessStream ^ captureStream, 34 | Windows::Storage::Streams::IBuffer ^* intermediateBuffer, 35 | unsigned char** captureBytes); 36 | 37 | Windows::Media::MediaProperties::MediaPixelFormat m_pixelFormat = 38 | Windows::Media::MediaProperties::MediaPixelFormat::Bgra8; 39 | 40 | int m_pixelFormatBpp = 4; 41 | int m_pixelFormatRedIndex = 2; 42 | int m_pixelFormatGreenIndex = 1; 43 | int m_pixelFormatBlueIndex = 0; 44 | }; 45 | 46 | } // namespace Win32 47 | } // namespace Platforms 48 | } // namespace HoloJs 49 | -------------------------------------------------------------------------------- /windows/src/common-lib/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /windows/src/common-lib/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #define NOMINMAX 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include -------------------------------------------------------------------------------- /windows/src/common-lib/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /windows/src/common-lib/websocket.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "holojs/private/websocket.h" 4 | #include 5 | #include 6 | #include 7 | 8 | namespace HoloJs { 9 | namespace Platforms { 10 | namespace Win32 { 11 | class WebSocket : public HoloJs::IWebSocket, public HoloJs::EventTarget { 12 | public: 13 | WebSocket(HoloJs::IHoloJsScriptHostInternal* host) : m_host(host) {} 14 | virtual ~WebSocket() { Release(); } 15 | virtual void Release(); 16 | 17 | virtual int getReadyState() { return static_cast(m_readyState); } 18 | 19 | virtual void connect(const std::wstring& url, const std::vector& protocols); 20 | virtual void send(const std::wstring& message); 21 | virtual void send(unsigned char* data, unsigned int dataSize, JsValueRef dataRef); 22 | virtual void send(HoloJs::IBlob* blob, JsValueRef dataRef); 23 | virtual void close(int code, const std::wstring& reason); 24 | 25 | private: 26 | HoloJs::IHoloJsScriptHostInternal* m_host; 27 | 28 | // Must match https://www.w3.org/TR/websockets/ 29 | enum class ReadyState : unsigned short { CONNECTING = 0, OPEN = 1, CLOSING = 2, CLOSED = 3 }; 30 | 31 | ReadyState m_readyState; 32 | 33 | std::wstring m_url; 34 | std::wstring m_protocols; 35 | std::wstring m_binaryType; 36 | 37 | Windows::Networking::Sockets::MessageWebSocket ^ m_webSocket; 38 | void onClosed(Windows::Networking::Sockets::IWebSocket ^ sender, 39 | Windows::Networking::Sockets::WebSocketClosedEventArgs ^ args); 40 | void onMessageReceived(Windows::Networking::Sockets::MessageWebSocket ^ sender, 41 | Windows::Networking::Sockets::MessageWebSocketMessageReceivedEventArgs ^ args); 42 | 43 | void handleConnectFail(); 44 | void handleConnectSuccess(); 45 | 46 | std::mutex m_asyncWorkLock; 47 | }; 48 | 49 | } // namespace Win32 50 | } // namespace Platforms 51 | } // namespace HoloJs 52 | -------------------------------------------------------------------------------- /windows/src/context2d-lib/context2d-lib.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;ipp;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 | {6d0b5d20-e18a-48e4-8656-85e77de70a73} 18 | 19 | 20 | {c7dc42b5-2e78-408d-a1f9-9b9e1c764c82} 21 | 22 | 23 | {6ea13e56-a73d-450c-9565-5b1a95da05b0} 24 | 25 | 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | include\holojs\windows 35 | 36 | 37 | Header Files 38 | 39 | 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | -------------------------------------------------------------------------------- /windows/src/context2d-lib/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /windows/src/context2d-lib/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | 12 | #include 13 | 14 | // reference additional headers your program requires here 15 | -------------------------------------------------------------------------------- /windows/src/context2d-lib/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /windows/src/context2d-lib/win2d-c-interface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | STDAPI getRenderTarget(void* deviceUnknown, 5 | float width, 6 | float height, 7 | float dpi, 8 | Windows::Graphics::DirectX::DirectXPixelFormat pixelFormat, 9 | Microsoft::Graphics::Canvas::CanvasAlphaMode alphaMode, 10 | void** renderTargetUnknown); 11 | 12 | STDAPI getSharedDevice(void** deviceUnknown); 13 | 14 | STDAPI getCanvasTextFormat(void** canvasTextFormatUnknown); 15 | 16 | STDAPI getCanvasStrokeStyle(void** canvasStrokeStyleUnknown); 17 | 18 | STDAPI getCanvasLinearGradientBrush(void* rendererUnknown, 19 | Microsoft::Graphics::Canvas::Brushes::CanvasGradientStop* stops, 20 | unsigned int stopCount, 21 | void** canvasLinearGradientBrushUnknown); 22 | 23 | STDAPI createCanvasBitmapFromBytes(void* rendererUnknown, 24 | unsigned int byteCount, 25 | unsigned char* bytes, 26 | int width, 27 | int height, 28 | Windows::Graphics::DirectX::DirectXPixelFormat pixelFormat, 29 | void** canvasBitmapUnknown); 30 | 31 | STDAPI getCanvasPathBuilder(void* sessionUnknown, void** canvasPathBuilderUnknown); 32 | 33 | STDAPI getCanvasTextLayout(void* sessionUnknown, const wchar_t* text, void* canvasTextFormatUnknown, float width, float height, void** canvasPathBuilderUnknown); 34 | 35 | STDAPI canvasGeometryCreatePath(void* pathUnknown, void** canvasGeometryUnknown); -------------------------------------------------------------------------------- /windows/src/core-lib/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /windows/src/dotnet-component/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("libholojs-net-interop")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("libholojs-net-interop")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("fd33cce1-4866-4a63-b9bb-fffd4d75d726")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /windows/src/test/unittest/EventTargetTests.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include 3 | #include "event-target-tests.h" 4 | #include "holojs/holojs.h" 5 | 6 | using namespace Microsoft::VisualStudio::CppUnitTestFramework; 7 | using namespace HoloJs; 8 | using namespace std; 9 | using namespace concurrency; 10 | using namespace libholojsunittest; 11 | 12 | class EventTestsChecker : public IConsoleConfiguration { 13 | public: 14 | bool textLoaded; 15 | 16 | virtual void onConsoleLog(const wchar_t* message) 17 | { 18 | if (wcscmp(message, L"loaded text") == 0) 19 | { 20 | textLoaded = true; 21 | } 22 | } 23 | 24 | virtual void onConsoleDebug(const wchar_t* message) {} 25 | }; 26 | 27 | 28 | void EventTargetTests::AddRemoveEventListenerTest() 29 | { 30 | PCWSTR script = 31 | L"function listener1 () { \ 32 | } \ 33 | function listener2 () { \ 34 | } \ 35 | function listener3 () { \ 36 | } \ 37 | \ 38 | var oReq = new XMLHttpRequest(); \ 39 | oReq.addEventListener('load', listener1); \ 40 | oReq.addEventListener('load', listener1); \ 41 | oReq.addEventListener('load', listener2); \ 42 | oReq.addEventListener('error', listener3); \ 43 | oReq.removeEventListener('error', listener2); \ 44 | oReq.removeEventListener('load', listener2); "; 45 | //oReq.open('GET', 'http:/localhost:8000/vr-cubes.json'); \ 46 | //oReq.send();"; 47 | 48 | std::shared_ptr scriptHost( 49 | HoloJs::CreateHoloJsScriptHost(), &HoloJs::DeleteHoloJsScriptHost); 50 | 51 | unique_ptr consoleConfig = make_unique(); 52 | scriptHost->setConsoleConfig(static_cast(consoleConfig.get())); 53 | 54 | auto configuration = HoloJs::ViewConfiguration(); 55 | Assert::IsTrue(SUCCEEDED(scriptHost->initialize(configuration)), L"Failed to initialize script host"); 56 | 57 | auto failure_task = complete_after(10000).then([scriptHost] { scriptHost->stopExecution(); }); 58 | 59 | scriptHost->start(script); 60 | } 61 | -------------------------------------------------------------------------------- /windows/src/test/unittest/basic-tests.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "CppUnitTest.h" 3 | #include "timer-tests.h" 4 | #include "console-tests.h" 5 | #include "web-loader-tests.h" 6 | #include "xhr-tests.h" 7 | #include "event-target-tests.h" 8 | 9 | using namespace Microsoft::VisualStudio::CppUnitTestFramework; 10 | // using namespace HoloJs; 11 | using namespace std; 12 | using namespace libholojsunittest; 13 | 14 | TEST_CLASS(BasicTests){public : TEST_METHOD(ConsoleLogTest){ConsoleTestsClass::RunConsoleLogTest(); 15 | } // namespace libholojsunittest 16 | 17 | TEST_METHOD(ConsoleDebugTest) { ConsoleTestsClass::RunConsoleDebugTest(); } 18 | TEST_METHOD(TimeoutTest) { TimersTest::TimeoutTest(); } 19 | TEST_METHOD(IntervalTest) { TimersTest::IntervalTest(); } 20 | TEST_METHOD(ClearTimersTest) { TimersTest::ClearTimerTest(); } 21 | TEST_METHOD(WebLoadSuccessTest) { WebLoaderTests::WebLoadAppTest(); } 22 | TEST_METHOD(WebLoadFailTest) { WebLoaderTests::FailWebLoadAppTest(); } 23 | 24 | TEST_METHOD(EventListenerTests) { EventTargetTests::AddRemoveEventListenerTest(); } 25 | } 26 | ; -------------------------------------------------------------------------------- /windows/src/test/unittest/blob-tests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace libholojsunittest { 4 | class BlobTests { 5 | public: 6 | // Test that console.log works as expected 7 | static void CreateFromArrayBufferView(); 8 | static void CreateFromString(); 9 | static void CreateFromArrayBufferNoType(); 10 | static void CreateFromArrayBufferWithType(); 11 | static void CreateFromArrayBufferWithoutOptions(); 12 | static void CreateFromBlob(); 13 | static void CreateFromBadBlob(); 14 | static void CreateFromCombinationParts(); 15 | }; 16 | } // namespace libholojsunittest -------------------------------------------------------------------------------- /windows/src/test/unittest/console-tests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace libholojsunittest { 4 | class ConsoleTestsClass { 5 | public: 6 | // Test that console.log works as expected 7 | static void RunConsoleLogTest(); 8 | static void RunConsoleDebugTest(); 9 | }; 10 | } // namespace libholojsunittest -------------------------------------------------------------------------------- /windows/src/test/unittest/event-target-tests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace libholojsunittest { 3 | class EventTargetTests 4 | { 5 | public: 6 | EventTargetTests() {} 7 | ~EventTargetTests() {} 8 | 9 | static void AddRemoveEventListenerTest(); 10 | }; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /windows/src/test/unittest/http-server/post-server.py: -------------------------------------------------------------------------------- 1 | import SimpleHTTPServer 2 | import SocketServer 3 | import logging 4 | import cgi 5 | 6 | import sys 7 | 8 | 9 | if len(sys.argv) > 2: 10 | PORT = int(sys.argv[2]) 11 | I = sys.argv[1] 12 | elif len(sys.argv) > 1: 13 | PORT = int(sys.argv[1]) 14 | I = "" 15 | else: 16 | PORT = 8001 17 | I = "" 18 | 19 | 20 | class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): 21 | 22 | def do_GET(self): 23 | logging.warning("======= GET STARTED =======") 24 | logging.warning(self.headers) 25 | SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self) 26 | 27 | def do_POST(self): 28 | logging.warning("======= POST STARTED =======") 29 | logging.warning(self.headers) 30 | self.send_response(200) 31 | 32 | Handler = ServerHandler 33 | 34 | httpd = SocketServer.TCPServer(("", PORT), Handler) 35 | 36 | print "@rochacbruno Python http server version 0.1 (for testing purposes only)" 37 | print "Serving at: http://%(interface)s:%(port)s" % dict(interface=I or "localhost", port=PORT) 38 | httpd.serve_forever() -------------------------------------------------------------------------------- /windows/src/test/unittest/http-server/test-content/ballshooter.xrs: -------------------------------------------------------------------------------- 1 | {"scripts":["threejs/three.js","threejs/control/orbitcontrols.js","threejs/geometries/BoxLineGeometry.js","appcode/ballshooter.js"]} -------------------------------------------------------------------------------- /windows/src/test/unittest/http-server/test-content/bouncing-sound.xrs: -------------------------------------------------------------------------------- 1 | {"scripts":["threejs/three.js","threejs/control/orbitcontrols.js","appcode/bouncing-sound.js"],"resources":["media/sounds/ping_pong.mp3"],"name":"","HtmlAppName":"bouncing-sound.html"} -------------------------------------------------------------------------------- /windows/src/test/unittest/http-server/test-content/media/sounds/ping_pong.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/test/unittest/http-server/test-content/media/sounds/ping_pong.mp3 -------------------------------------------------------------------------------- /windows/src/test/unittest/http-server/test-content/threejs/geometries/ConvexGeometry.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Mugen87 / https://github.com/Mugen87 3 | */ 4 | 5 | ( function () { 6 | 7 | // ConvexGeometry 8 | 9 | function ConvexGeometry( points ) { 10 | 11 | THREE.Geometry.call( this ); 12 | 13 | this.fromBufferGeometry( new ConvexBufferGeometry( points ) ); 14 | this.mergeVertices(); 15 | 16 | } 17 | 18 | ConvexGeometry.prototype = Object.create( THREE.Geometry.prototype ); 19 | ConvexGeometry.prototype.constructor = ConvexGeometry; 20 | 21 | // ConvexBufferGeometry 22 | 23 | function ConvexBufferGeometry( points ) { 24 | 25 | THREE.BufferGeometry.call( this ); 26 | 27 | // buffers 28 | 29 | var vertices = []; 30 | var normals = []; 31 | 32 | // execute QuickHull 33 | 34 | if ( THREE.QuickHull === undefined ) { 35 | 36 | console.error( 'THREE.ConvexBufferGeometry: ConvexBufferGeometry relies on THREE.QuickHull' ); 37 | 38 | } 39 | 40 | var quickHull = new THREE.QuickHull().setFromPoints( points ); 41 | 42 | // generate vertices and normals 43 | 44 | var faces = quickHull.faces; 45 | 46 | for ( var i = 0; i < faces.length; i ++ ) { 47 | 48 | var face = faces[ i ]; 49 | var edge = face.edge; 50 | 51 | // we move along a doubly-connected edge list to access all face points (see HalfEdge docs) 52 | 53 | do { 54 | 55 | var point = edge.head().point; 56 | 57 | vertices.push( point.x, point.y, point.z ); 58 | normals.push( face.normal.x, face.normal.y, face.normal.z ); 59 | 60 | edge = edge.next; 61 | 62 | } while ( edge !== face.edge ); 63 | 64 | } 65 | 66 | // build geometry 67 | 68 | this.addAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) ); 69 | this.addAttribute( 'normal', new THREE.Float32BufferAttribute( normals, 3 ) ); 70 | 71 | } 72 | 73 | ConvexBufferGeometry.prototype = Object.create( THREE.BufferGeometry.prototype ); 74 | ConvexBufferGeometry.prototype.constructor = ConvexBufferGeometry; 75 | 76 | // export 77 | 78 | THREE.ConvexGeometry = ConvexGeometry; 79 | THREE.ConvexBufferGeometry = ConvexBufferGeometry; 80 | 81 | } )(); 82 | -------------------------------------------------------------------------------- /windows/src/test/unittest/http-server/websocket_server-runner.py: -------------------------------------------------------------------------------- 1 | from websocket_server import WebsocketServer 2 | 3 | # Called for every client connecting (after handshake) 4 | def new_client(client, server): 5 | print("New client connected and was given id %d" % client['id']) 6 | server.send_message_to_all("server message") 7 | 8 | 9 | # Called for every client disconnecting 10 | def client_left(client, server): 11 | print("Client(%d) disconnected" % client['id']) 12 | 13 | 14 | # Called when a client sends a message 15 | def message_received(client, server, message): 16 | if len(message) > 200: 17 | message = message[:200]+'..' 18 | print("Client(%d) said: %s" % (client['id'], message)) 19 | server.send_message_to_all("server echo") 20 | 21 | 22 | PORT=9001 23 | server = WebsocketServer(PORT) 24 | server.set_fn_new_client(new_client) 25 | server.set_fn_client_left(client_left) 26 | server.set_fn_message_received(message_received) 27 | server.run_forever() 28 | -------------------------------------------------------------------------------- /windows/src/test/unittest/http-server/websocket_server.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/test/unittest/http-server/websocket_server.pyc -------------------------------------------------------------------------------- /windows/src/test/unittest/image-tests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace libholojsunittest { 3 | class ImageTests { 4 | public: 5 | ImageTests() {} 6 | ~ImageTests() {} 7 | 8 | static void LoadImageTest(); 9 | static void LoadUrlNotFoundTest(); 10 | static void LoadInvalidUrlTest(); 11 | static void loadDataUrlImage(); 12 | static void loadInvalidDataUrlImage(); 13 | }; 14 | } // namespace libholojsunittest -------------------------------------------------------------------------------- /windows/src/test/unittest/resource-utilization-tests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace libholojsunittest { 3 | class ResourceUtilizationTests { 4 | public: 5 | ResourceUtilizationTests() {} 6 | ~ResourceUtilizationTests() {} 7 | 8 | static void ScriptHostResourceReleaseTest(); 9 | static void Canvas2DResourceRelease(); 10 | static void CanvasImageDataRelease(); 11 | }; 12 | } // namespace libholojsunittest -------------------------------------------------------------------------------- /windows/src/test/unittest/spatial-anchor-test.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "CppUnitTest.h" 5 | #include "spatial-anchor-test.h" 6 | #include "holojs/holojs.h" 7 | #include 8 | 9 | using namespace Microsoft::VisualStudio::CppUnitTestFramework; 10 | using namespace HoloJs; 11 | using namespace std; 12 | 13 | using namespace libholojsunittest; 14 | 15 | TEST_CLASS(SpatialAnchor) 16 | { 17 | public: 18 | TEST_METHOD(createAnchor) { SpatialAnchorTests::createAnchor(); } 19 | } 20 | ; 21 | 22 | class SpatialAnchorChecker : public IConsoleConfiguration { 23 | public: 24 | bool created; 25 | 26 | virtual void onConsoleLog(const wchar_t* message) 27 | { 28 | if (_wcsicmp(message, L"created") == 0) { 29 | created = true; 30 | } 31 | } 32 | 33 | virtual void onConsoleDebug(const wchar_t* message) {} 34 | }; 35 | 36 | void SpatialAnchorTests::createAnchor() 37 | { 38 | PCWSTR script = 39 | L"var anchor = new SpatialAnchor({ position : {x : 0.0, y : 0.0, z : 0.0}});\ 40 | console.log('created');\ 41 | "; 42 | 43 | shared_ptr consoleConfig = make_shared(); 44 | shared_ptr scriptHost(HoloJs::CreateHoloJsScriptHost(), &DeleteHoloJsScriptHost); 45 | 46 | scriptHost->setConsoleConfig(static_cast(consoleConfig.get())); 47 | 48 | auto configuration = HoloJs::ViewConfiguration(); 49 | Assert::IsTrue(SUCCEEDED(scriptHost->initialize(configuration))); 50 | 51 | complete_after(1000).then([scriptHost, consoleConfig] { scriptHost->stopExecution(); }); 52 | 53 | Assert::IsTrue(SUCCEEDED(scriptHost->start(script))); 54 | 55 | Assert::IsTrue(consoleConfig->created); 56 | } -------------------------------------------------------------------------------- /windows/src/test/unittest/spatial-anchor-test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace libholojsunittest { 4 | class SpatialAnchorTests { 5 | public: 6 | // Test that console.log works as expected 7 | static void createAnchor(); 8 | }; 9 | } // namespace libholojsunittest -------------------------------------------------------------------------------- /windows/src/test/unittest/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // libholojs-unittest.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | using namespace concurrency; 8 | 9 | // TODO: reference any additional headers you need in STDAFX.H 10 | // and not in this file 11 | 12 | // Creates a task that completes after the specified delay. 13 | task complete_after(unsigned int timeout) 14 | { 15 | // A task completion event that is set when a timer fires. 16 | task_completion_event tce; 17 | 18 | // Create a non-repeating timer. 19 | auto fire_once = new timer(timeout, 0, nullptr, false); 20 | // Create a call object that sets the completion event after the timer fires. 21 | auto callback = new call([tce](int) { tce.set(); }); 22 | 23 | // Connect the timer to the callback and start the timer. 24 | fire_once->link_target(callback); 25 | fire_once->start(); 26 | 27 | // Create a task that completes after the completion event is set. 28 | task event_set(tce); 29 | 30 | // Create a continuation task that cleans up resources and 31 | // and return that continuation task. 32 | return event_set.then([callback, fire_once]() { 33 | delete callback; 34 | delete fire_once; 35 | }); 36 | } 37 | -------------------------------------------------------------------------------- /windows/src/test/unittest/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | #include 8 | #include 9 | #include "targetver.h" 10 | 11 | // Headers for CppUnitTest 12 | #include "CppUnitTest.h" 13 | 14 | #include 15 | #include 16 | concurrency::task complete_after(unsigned int timeout); -------------------------------------------------------------------------------- /windows/src/test/unittest/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /windows/src/test/unittest/timer-tests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace libholojsunittest { 4 | 5 | class TimersTest { 6 | public: 7 | static void TimeoutTest(); 8 | static void IntervalTest(); 9 | static void ClearTimerTest(); 10 | }; 11 | } // namespace libholojsunittest 12 | -------------------------------------------------------------------------------- /windows/src/test/unittest/web-loader-tests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace libholojsunittest { 3 | 4 | class WebLoaderTests { 5 | public: 6 | static void FailWebLoadAppTest(); 7 | static void WebLoadAppTest(); 8 | }; 9 | } // namespace libholojsunittest 10 | 11 | -------------------------------------------------------------------------------- /windows/src/test/unittest/webaudio-tests.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "holojs/holojs.h" 3 | #include "webaudio-tests.h" 4 | #include 5 | 6 | using namespace Microsoft::VisualStudio::CppUnitTestFramework; 7 | using namespace HoloJs; 8 | using namespace std; 9 | using namespace concurrency; 10 | using namespace libholojsunittest; 11 | 12 | TEST_CLASS(WebAudio){public : 13 | 14 | TEST_METHOD(PlayOggFile){WebAudioTests::PlayOggFile(); 15 | } 16 | } 17 | ; 18 | 19 | class WebAudioChecker : public IConsoleConfiguration { 20 | public: 21 | bool decoded; 22 | bool error; 23 | bool ended; 24 | 25 | virtual void onConsoleLog(const wchar_t* message) 26 | { 27 | if (wcscmp(message, L"decoded") == 0) { 28 | decoded = true; 29 | } else if (wcscmp(message, L"error") == 0) { 30 | error = true; 31 | } else if (wcscmp(message, L"ended") == 0) { 32 | ended = true; 33 | } 34 | } 35 | 36 | virtual void onConsoleDebug(const wchar_t* message) {} 37 | }; 38 | 39 | void WebAudioTests::PlayOggFile() 40 | { 41 | std::shared_ptr scriptHost(HoloJs::CreateHoloJsScriptHost(), 42 | &HoloJs::DeleteHoloJsScriptHost); 43 | 44 | unique_ptr consoleConfig = make_unique(); 45 | scriptHost->setConsoleConfig(static_cast(consoleConfig.get())); 46 | 47 | auto configuration = HoloJs::ViewConfiguration(); 48 | Assert::IsTrue(SUCCEEDED(scriptHost->initialize(configuration)), L"Failed to initialize script host"); 49 | 50 | auto failure_task = complete_after(10000).then([scriptHost] { scriptHost->stopExecution(); }); 51 | 52 | scriptHost->startUri(L"http://localhost:8001/test-content/bouncing-sound.xrs"); 53 | 54 | Assert::IsTrue(consoleConfig->decoded); 55 | Assert::IsTrue(consoleConfig->ended); 56 | Assert::IsFalse(consoleConfig->error); 57 | } -------------------------------------------------------------------------------- /windows/src/test/unittest/webaudio-tests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace libholojsunittest { 3 | class WebAudioTests { 4 | public: 5 | WebAudioTests() {} 6 | ~WebAudioTests() {} 7 | 8 | static void PlayOggFile(); 9 | }; 10 | } // namespace libholojsunittest 11 | -------------------------------------------------------------------------------- /windows/src/test/unittest/websocket-test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace libholojsunittest { 4 | class WebSocketTest { 5 | public: 6 | static void CreateNoProtocol(); 7 | static void CreateOneProtocol(); 8 | static void CreateMultipleProtocols(); 9 | static void CreateInvalidProtocolArg(); 10 | static void CreateInvalidUrlArg(); 11 | 12 | static void SendTextMessageTest(); 13 | static void SendArrayBufferTest(); 14 | static void SendBlobTest(); 15 | 16 | static void Close(); 17 | 18 | static void ConnectSuccess(); 19 | static void ConnectBadUrl(); 20 | }; 21 | } // namespace libholojsunittest -------------------------------------------------------------------------------- /windows/src/test/unittest/window-tests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace libholojsunittest { 3 | class WindowTests { 4 | public: 5 | WindowTests() {} 6 | ~WindowTests() {} 7 | 8 | static void CheckWindowElements(); 9 | }; 10 | } // namespace libholojsunittest 11 | -------------------------------------------------------------------------------- /windows/src/test/unittest/xhr-tests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace libholojsunittest { 3 | class XHRTests { 4 | public: 5 | XHRTests() {} 6 | ~XHRTests() {} 7 | 8 | static void DownloadBinaryTest(); 9 | static void DownloadNotFoundResourceTest(); 10 | static void DownloadTextTest(); 11 | static void OnReadyStateChangeTest(); 12 | static void GetResponseHeadersTest(); 13 | static void PostTextTest(); 14 | static void PostBinaryTest(); 15 | }; 16 | } // namespace libholojsunittest -------------------------------------------------------------------------------- /windows/src/test/uwp/App.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "App.h" 3 | #include 4 | 5 | // The main function is only used to start the script host 6 | [Platform::MTAThread] int main(Platform::Array ^) { 7 | auto scriptHost = ref new HoloJs::UWP::HoloJsScriptHost(); 8 | auto viewConfiguration = ref new HoloJs::UWP::ViewConfiguration(); 9 | 10 | std::wstring deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily->Data(); 11 | //if (_wcsicmp(deviceFamily.c_str(), L"Windows.Holographic") == 0) { 12 | viewConfiguration->enableVoiceCommands(); 13 | viewConfiguration->enableQrCodeNavigation(); 14 | //} 15 | 16 | viewConfiguration->setViewMode(HoloJs::UWP::ViewMode::Default); 17 | if (scriptHost->initialize(viewConfiguration)) { 18 | auto uri = ref new Platform::String(L"e:\\src\\first-app\first-app.json"); 19 | scriptHost->startUri(uri); 20 | //scriptHost->startWithEmptyApp(); 21 | } 22 | 23 | return 0; 24 | } -------------------------------------------------------------------------------- /windows/src/test/uwp/App.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | -------------------------------------------------------------------------------- /windows/src/test/uwp/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/test/uwp/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /windows/src/test/uwp/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/test/uwp/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /windows/src/test/uwp/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/test/uwp/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /windows/src/test/uwp/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/test/uwp/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /windows/src/test/uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/test/uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /windows/src/test/uwp/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/test/uwp/Assets/StoreLogo.png -------------------------------------------------------------------------------- /windows/src/test/uwp/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/test/uwp/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /windows/src/test/uwp/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /windows/src/test/uwp/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include -------------------------------------------------------------------------------- /windows/src/test/uwp/uwp-test.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 0c116ddf-e5cb-4e83-9257-9d17488fa8b5 6 | bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png 7 | 8 | 9 | Assets 10 | 11 | 12 | Assets 13 | 14 | 15 | Assets 16 | 17 | 18 | Assets 19 | 20 | 21 | Assets 22 | 23 | 24 | Assets 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | Assets 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /windows/src/test/win32/holojs_test.cpp: -------------------------------------------------------------------------------- 1 | // holojs_test.cpp : This file contains the 'main' function. Program execution begins and ends there. 2 | // 3 | 4 | #include "pch.h" 5 | #include "holojs/holojs.h" 6 | #include 7 | #include 8 | #include 9 | 10 | using namespace HoloJs; 11 | 12 | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) 13 | { 14 | std::shared_ptr scriptHost(HoloJs::CreateHoloJsScriptHost(), 15 | &HoloJs::DeleteHoloJsScriptHost); 16 | 17 | auto configuration = HoloJs::ViewConfiguration(); 18 | configuration.enableVoiceCommands = true; 19 | scriptHost->initialize(configuration); 20 | 21 | scriptHost->startUri(L"e:\\src\\first-app\\first-app.json"); 22 | //scriptHost->startWithEmptyApp(); 23 | return 0; 24 | } -------------------------------------------------------------------------------- /windows/src/test/win32/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: source file corresponding to pre-compiled header; necessary for compilation to succeed 2 | 3 | #include "pch.h" 4 | 5 | // In general, ignore this file, but keep it around if you are using pre-compiled headers. 6 | -------------------------------------------------------------------------------- /windows/src/test/win32/pch.h: -------------------------------------------------------------------------------- 1 | // Tips for Getting Started: 2 | // 1. Use the Solution Explorer window to add/manage files 3 | // 2. Use the Team Explorer window to connect to source control 4 | // 3. Use the Output window to see build output and other messages 5 | // 4. Use the Error List window to view errors 6 | // 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project 7 | // 6. In the future, to open this project again, go to File > Open > Project and select the .sln file 8 | 9 | #ifndef PCH_H 10 | #define PCH_H 11 | 12 | // TODO: add headers that you want to pre-compile here 13 | 14 | #endif //PCH_H 15 | -------------------------------------------------------------------------------- /windows/src/test/win32/test-console-config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "CppUnitTest.h" 5 | #include "holojs.h" 6 | #include 7 | 8 | 9 | class ConsoleConfig : public IConsoleConfiguration { 10 | public: 11 | int logCount = 0; 12 | int debugCount = 0; 13 | const wchar_t* expectedMessage; 14 | 15 | virtual void onConsoleLog(const wchar_t* message) 16 | { 17 | Assert::IsTrue(wcscmp(expectedMessage, message) == 0); 18 | logCount++; 19 | } 20 | virtual void onConsoleDebug(const wchar_t* message) { debugCount++; } 21 | }; -------------------------------------------------------------------------------- /windows/src/test/win32/win32-test.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;ipp;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 | Header Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | -------------------------------------------------------------------------------- /windows/src/uwp-component/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /windows/src/uwp-component/scripts/2d-context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/uwp-component/scripts/2d-context.js -------------------------------------------------------------------------------- /windows/src/uwp-component/scripts/console.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/uwp-component/scripts/console.js -------------------------------------------------------------------------------- /windows/src/uwp-component/scripts/dom.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/uwp-component/scripts/dom.js -------------------------------------------------------------------------------- /windows/src/uwp-component/scripts/gamepad.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/uwp-component/scripts/gamepad.js -------------------------------------------------------------------------------- /windows/src/uwp-component/scripts/timers.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/uwp-component/scripts/timers.js -------------------------------------------------------------------------------- /windows/src/uwp-component/scripts/webgl-context.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/uwp-component/scripts/webgl-context.js -------------------------------------------------------------------------------- /windows/src/uwp-component/scripts/webvr.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/uwp-component/scripts/webvr.js -------------------------------------------------------------------------------- /windows/src/uwp-component/scripts/window.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/uwp-component/scripts/window.js -------------------------------------------------------------------------------- /windows/src/uwp-component/scripts/xmlhttprequest.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/uwp-component/scripts/xmlhttprequest.js -------------------------------------------------------------------------------- /windows/src/uwp-component/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /windows/src/uwp-component/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define HOLOJS_USE_JSRT 11 | 12 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 13 | // Windows Header Files 14 | #include 15 | 16 | #include "holojs/private/error-handling.h" 17 | // reference additional headers your program requires here 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | // Enable function definitions in the GL headers below 35 | #define GL_GLEXT_PROTOTYPES 36 | #define EGL_EGL_PROTOTYPES 1 37 | 38 | // OpenGL ES includes 39 | #include 40 | #include 41 | 42 | // EGL includes 43 | #include 44 | #include 45 | #include 46 | -------------------------------------------------------------------------------- /windows/src/uwp-component/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /windows/src/uwp-component/uwp-mixed-reality-context.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "uwp-mixed-reality-context.h" 3 | #include "uwp-spatial-input.h" 4 | 5 | using namespace HoloJs::UWP; 6 | using namespace Windows::Graphics::Holographic; 7 | using namespace std; 8 | 9 | HRESULT UWPMixedRealityContext::createHolographicSpace() 10 | 11 | { 12 | RETURN_IF_FALSE(m_coreWindow); 13 | 14 | m_holographicSpace = HolographicSpace::CreateForCoreWindow(m_coreWindow.Get()); 15 | 16 | return S_OK; 17 | } -------------------------------------------------------------------------------- /windows/src/uwp-component/uwp-mixed-reality-context.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "holojs/windows/mixed-reality/mixed-reality-context.h" 4 | 5 | namespace HoloJs { 6 | namespace UWP { 7 | class UWPMixedRealityContext : public HoloJs::MixedReality::MixedRealityContext { 8 | public: 9 | UWPMixedRealityContext() {} 10 | ~UWPMixedRealityContext() {} 11 | 12 | virtual HRESULT createHolographicSpace(); 13 | }; 14 | } // namespace Win32 15 | } // namespace HoloJs -------------------------------------------------------------------------------- /windows/src/uwp-component/uwp-opengl-context.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "holojs/windows/mixed-reality/mixed-reality-context.h" 3 | #include "holojs/private/error-handling.h" 4 | #include "uwp-opengl-context.h" 5 | 6 | using namespace HoloJs::OpenGL; 7 | using namespace std; 8 | using namespace HoloJs::Win32; 9 | using namespace Windows::Foundation::Collections; 10 | 11 | HRESULT UWPOpenGLContext::createEGLWindowSurface() 12 | { 13 | PropertySet ^ surfaceCreationProperties = ref new PropertySet(); 14 | surfaceCreationProperties->Insert(ref new Platform::String(L"EGLNativeWindowTypeProperty"), m_coreWindow.Get()); 15 | 16 | m_EglSurface = eglCreateWindowSurface( 17 | m_EglDisplay, m_EglConfig, reinterpret_cast(surfaceCreationProperties), nullptr); 18 | RETURN_IF_TRUE(m_EglSurface == EGL_NO_SURFACE); 19 | 20 | return S_OK; 21 | } -------------------------------------------------------------------------------- /windows/src/uwp-component/uwp-opengl-context.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "holojs/windows/opengl-context.h" 4 | 5 | namespace HoloJs { 6 | namespace Win32 { 7 | 8 | class UWPOpenGLContext : public HoloJs::OpenGL::OpenGLContext { 9 | public: 10 | UWPOpenGLContext() {} 11 | virtual ~UWPOpenGLContext() {} 12 | 13 | virtual HRESULT createEGLWindowSurface(); 14 | }; 15 | 16 | } // namespace Win32 17 | } // namespace HoloJs 18 | -------------------------------------------------------------------------------- /windows/src/uwp-component/uwp-spatial-input.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "uwp-spatial-input.h" 3 | 4 | using namespace Windows::UI::Input::Spatial; 5 | using namespace std; 6 | using namespace HoloJs::UWP; 7 | 8 | HRESULT UWPSpatialInput::createSpatialInteractionManager() 9 | { 10 | m_spatialInteractionManager = SpatialInteractionManager::GetForCurrentView(); 11 | 12 | return S_OK; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /windows/src/uwp-component/uwp-spatial-input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "holojs/windows/mixed-reality/spatial-input.h" 4 | 5 | namespace HoloJs { 6 | namespace UWP { 7 | class UWPSpatialInput : public HoloJs::MixedReality::Input::SpatialInput { 8 | public: 9 | UWPSpatialInput() {} 10 | ~UWPSpatialInput() {} 11 | 12 | protected: 13 | 14 | virtual HRESULT createSpatialInteractionManager(); 15 | }; 16 | } // namespace Win32 17 | } // namespace HoloJs -------------------------------------------------------------------------------- /windows/src/uwp-component/uwp/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../stdafx.h" -------------------------------------------------------------------------------- /windows/src/uwp-component/uwp/uwp-platform.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "holojs/holojs.h" 3 | #include "holojs/windows/render-context-2d.h" 4 | #include "holojs/windows/xml-http-request.h" 5 | #include "holojs/windows/image-element.h" 6 | #include "holojs/private/error-handling.h" 7 | #include "uwp-platform.h" 8 | #include "winrt-view.h" 9 | #include 10 | #include 11 | #include 12 | 13 | static HoloJs::UWP::UWPPlatform UWPHoloJsPlatform; 14 | 15 | namespace HoloJs { 16 | HoloJs::IPlatform* __cdecl HoloJs::getPlatform() { return &UWPHoloJsPlatform; } 17 | } // namespace HoloJs 18 | 19 | using namespace HoloJs::UWP; 20 | using namespace Windows::Data::Json; 21 | using namespace Windows::Web::Http; 22 | using namespace Windows::Web; 23 | using namespace std; 24 | using namespace concurrency; 25 | 26 | HoloJs::IHoloJsView* UWPPlatform::makeView(HoloJs::ViewConfiguration viewConfig) { return new WinRTHoloJsView(viewConfig); } 27 | 28 | void UWPPlatform::enableDebugger(HoloJs::IHoloJsScriptHost* host, JsRuntimeHandle runtime) { 29 | JsStartDebugging(); 30 | } 31 | 32 | HRESULT UWPPlatform::readResourceScript(const wchar_t* name, std::wstring& scriptText) 33 | { 34 | wstring path = L"HoloJs.UWP\\"; 35 | path += name; 36 | 37 | return WindowsPlatform::readFileUnicode(path, scriptText); 38 | } 39 | 40 | HoloJs::IXmlHttpRequest* UWPPlatform::createXmlHttpRequest(HoloJs::IHoloJsScriptHostInternal* host) 41 | { 42 | return new HoloJs::Win32::XmlHttpRequest(host); 43 | } 44 | 45 | HoloJs::ICanvasRenderContext2D* UWPPlatform::createCanvasRenderContext2D() 46 | { 47 | return new HoloJs::WindowsPlatform::RenderContext2D(); 48 | } 49 | 50 | HoloJs::IIMage* UWPPlatform::createImage(HoloJs::IHoloJsScriptHostInternal* host) 51 | { 52 | return new HoloJs::Win32::Image(host); 53 | } 54 | -------------------------------------------------------------------------------- /windows/src/win32-component/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /windows/src/win32-component/performance-tracker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace HoloJs { 6 | class PerformaceTracker { 7 | public: 8 | PerformaceTracker(PCWSTR metricName, unsigned int threshold) : m_metricName(metricName), m_threshold(threshold) 9 | { 10 | QueryPerformanceFrequency(&m_timerFrequencyPerMs); 11 | m_timerFrequencyPerMs.QuadPart /= 1000; 12 | } 13 | 14 | inline void start() 15 | { 16 | #ifdef _DEBUG 17 | QueryPerformanceCounter(&m_startTimestamp); 18 | #endif 19 | } 20 | 21 | inline void end() 22 | { 23 | #ifdef _DEBUG 24 | if (m_startTimestamp.QuadPart == 0) { 25 | return; 26 | } 27 | 28 | LARGE_INTEGER endTimestamp; 29 | QueryPerformanceCounter(&endTimestamp); 30 | 31 | const auto elapsed = (endTimestamp.QuadPart - m_startTimestamp.QuadPart) / m_timerFrequencyPerMs.QuadPart; 32 | 33 | if (elapsed > m_threshold) { 34 | m_message = m_metricName; 35 | m_message.append(L" : "); 36 | m_message.append(std::to_wstring(elapsed)); 37 | m_message.append(L"\r\n"); 38 | 39 | OutputDebugString(m_message.c_str()); 40 | } 41 | #endif 42 | } 43 | 44 | private: 45 | LARGE_INTEGER m_startTimestamp; 46 | LARGE_INTEGER m_timerFrequencyPerMs; 47 | 48 | std::wstring m_metricName; 49 | std::wstring m_message; 50 | unsigned int m_threshold; 51 | }; 52 | } // namespace HoloJs 53 | -------------------------------------------------------------------------------- /windows/src/win32-component/script-debugger.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "script-debugger.h" 3 | 4 | using namespace std; 5 | using namespace HoloJs::Win32::Debugging; 6 | 7 | HRESULT ScriptDebugger::start(JsRuntimeHandle runtime) { 8 | JsErrorCode result = JsNoError; 9 | auto protocolHandler = std::make_unique(runtime); 10 | auto service = std::make_unique(); 11 | 12 | result = service->RegisterHandler("holojs_runtime", *protocolHandler, true /*break on next line*/); 13 | 14 | if (result == JsNoError) 15 | { 16 | result = service->Listen(9229); 17 | } 18 | 19 | if (result == JsNoError) 20 | { 21 | m_protocolHandler = std::move(protocolHandler); 22 | m_debugService = std::move(service); 23 | 24 | return S_OK; 25 | } 26 | else 27 | { 28 | return E_FAIL; 29 | } 30 | } 31 | HRESULT ScriptDebugger::waitForAttach() { 32 | return m_protocolHandler->WaitForDebugger() == JsNoError ? S_OK : E_FAIL; 33 | } -------------------------------------------------------------------------------- /windows/src/win32-component/script-debugger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #pragma once 3 | 4 | #include 5 | #include 6 | #include "debug-protocol-handler.h" 7 | #include "debug-service.h" 8 | 9 | namespace HoloJs { 10 | namespace Win32 { 11 | namespace Debugging { 12 | 13 | class ScriptDebugger { 14 | public: 15 | ScriptDebugger() {} 16 | ~ScriptDebugger() {} 17 | 18 | HRESULT start(JsRuntimeHandle runtime); 19 | HRESULT waitForAttach(); 20 | 21 | private: 22 | std::unique_ptr m_protocolHandler; 23 | std::unique_ptr m_debugService; 24 | }; 25 | } // namespace Debugging 26 | } // namespace Win32 27 | } // namespace HoloJs -------------------------------------------------------------------------------- /windows/src/win32-component/script-resources.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by script-resources.rc 4 | // 5 | #define CONSOLE_SCRIPT 101 6 | #define TIMERS_SCRIPT 102 7 | #define CONTEXT_2D_SCRIPT 103 8 | #define WEBGL_CONTEXT_SCRIPT 105 9 | #define WINDOW_SCRIPT 106 10 | #define WEBVR_SCRIPT 107 11 | #define GAMEPAD_SCRIPT 108 12 | #define XHR_SCRIPT 109 13 | #define IMAGE_SCRIPT 110 14 | #define URL_SCRIPT 111 15 | #define DOCUMENT_SCRIPT 112 16 | #define CANVAS_SCRIPT 113 17 | #define CANVASVR_SCRIPT 114 18 | #define WEBAUDIO_SCRIPT 115 19 | #define WEBSOCKET_SCRIPT 116 20 | #define SURFACE_MAPPER_SCRIPT 117 21 | #define THREEJS_SCRIPT 118 22 | #define LOADING_ANIMATION_SCRIPT 119 23 | #define SPEECH_RECOGNIZER_SCRIPT 120 24 | #define SPATIAL_ANCHORS_SCRIPT 121 25 | 26 | // Next default values for new objects 27 | // 28 | #ifdef APSTUDIO_INVOKED 29 | #ifndef APSTUDIO_READONLY_SYMBOLS 30 | #define _APS_NEXT_RESOURCE_VALUE 101 31 | #define _APS_NEXT_COMMAND_VALUE 40001 32 | #define _APS_NEXT_CONTROL_VALUE 1001 33 | #define _APS_NEXT_SYMED_VALUE 120 34 | #endif 35 | #endif 36 | -------------------------------------------------------------------------------- /windows/src/win32-component/script-resources.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/src/win32-component/script-resources.rc -------------------------------------------------------------------------------- /windows/src/win32-component/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /windows/src/win32-component/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | -------------------------------------------------------------------------------- /windows/src/win32-component/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /windows/src/win32-component/win32-mixed-reality-context.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../host-interfaces.h" 3 | #include "win32-mixed-reality-context.h" 4 | #include "holojs/private/script-host-utilities.h" 5 | #include "win32-spatial-input.h" 6 | #include <..\um\HolographicSpaceInterop.h> 7 | #include <..\winrt\WinRTBase.h> 8 | #include 9 | #include 10 | 11 | using namespace HoloJs::Win32; 12 | using namespace Microsoft::WRL; 13 | using namespace Microsoft::WRL::Wrappers; 14 | using namespace Windows::Graphics::Holographic; 15 | using namespace std; 16 | using namespace std::placeholders; 17 | using namespace concurrency; 18 | using namespace Windows::Foundation; 19 | using namespace concurrency; 20 | using namespace HoloJs::Interfaces; 21 | 22 | HRESULT Win32MixedRealityContext::createHolographicSpace() 23 | 24 | { 25 | RETURN_IF_TRUE(m_window == nullptr); 26 | 27 | ComPtr spHolographicSpaceFactory; 28 | RETURN_IF_FAILED(ABI::Windows::Foundation::GetActivationFactory( 29 | HStringReference(RuntimeClass_Windows_Graphics_Holographic_HolographicSpace).Get(), 30 | &spHolographicSpaceFactory)); 31 | 32 | ComPtr spHolographicSpaceInterop; 33 | RETURN_IF_FAILED(spHolographicSpaceFactory.As(&spHolographicSpaceInterop)); 34 | 35 | ComPtr holographicSpaceHWND; 36 | RETURN_IF_FAILED(spHolographicSpaceInterop->CreateForWindow(m_window, IID_PPV_ARGS(&holographicSpaceHWND))); 37 | 38 | m_holographicSpace = safe_cast( 39 | reinterpret_cast(holographicSpaceHWND.Get())); 40 | 41 | return S_OK; 42 | } 43 | -------------------------------------------------------------------------------- /windows/src/win32-component/win32-mixed-reality-context.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "holojs/windows/mixed-reality/mixed-reality-context.h" 4 | 5 | namespace HoloJs { 6 | namespace Win32 { 7 | class Win32MixedRealityContext : public HoloJs::MixedReality::MixedRealityContext { 8 | public: 9 | Win32MixedRealityContext() {} 10 | ~Win32MixedRealityContext() {} 11 | 12 | virtual HRESULT createHolographicSpace(); 13 | }; 14 | } // namespace Win32 15 | } // namespace HoloJs -------------------------------------------------------------------------------- /windows/src/win32-component/win32-opengl-context.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "holojs/windows/mixed-reality/mixed-reality-context.h" 3 | #include "win32-opengl-context.h" 4 | #include "holojs/private/error-handling.h" 5 | 6 | using namespace HoloJs::OpenGL; 7 | using namespace std; 8 | using namespace HoloJs::Win32; 9 | 10 | 11 | HRESULT Win32OpenGLContext::createEGLWindowSurface() 12 | { 13 | m_EglSurface = eglCreateWindowSurface(m_EglDisplay, m_EglConfig, m_window, nullptr); 14 | RETURN_IF_TRUE(m_EglSurface == EGL_NO_SURFACE); 15 | 16 | return S_OK; 17 | } -------------------------------------------------------------------------------- /windows/src/win32-component/win32-opengl-context.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "holojs/windows/opengl-context.h" 4 | 5 | namespace HoloJs { 6 | namespace Win32 { 7 | 8 | class Win32OpenGLContext : public HoloJs::OpenGL::OpenGLContext{ 9 | public: 10 | Win32OpenGLContext() {} 11 | virtual ~Win32OpenGLContext() {} 12 | 13 | virtual HRESULT createEGLWindowSurface(); 14 | }; 15 | 16 | } // namespace OpenGL 17 | } // namespace HoloJs 18 | -------------------------------------------------------------------------------- /windows/src/win32-component/win32-platform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "holojs/windows/windows-platform.h" 4 | #include "holojs/private/image-interface.h" 5 | #include "holojs/private/canvas-render-context-2d.h" 6 | #include "holojs/private/holojs-view.h" 7 | #include "holojs/private/platform-interfaces.h" 8 | #include "script-debugger.h" 9 | 10 | namespace HoloJs { 11 | namespace Win32 { 12 | 13 | class Win32Platform : public HoloJs::Platforms::WindowsPlatform { 14 | public: 15 | virtual IHoloJsView* makeView(HoloJs::ViewConfiguration viewConfig); 16 | 17 | virtual HRESULT readResourceScript(const wchar_t* name, std::wstring& scriptText); 18 | 19 | virtual HoloJs::IXmlHttpRequest* createXmlHttpRequest(HoloJs::IHoloJsScriptHostInternal* host); 20 | 21 | virtual HoloJs::ICanvasRenderContext2D* createCanvasRenderContext2D(); 22 | 23 | virtual HoloJs::IIMage* createImage(HoloJs::IHoloJsScriptHostInternal* host); 24 | 25 | virtual void enableDebugger(HoloJs::IHoloJsScriptHost* host, JsRuntimeHandle runtime); 26 | 27 | private: 28 | std::unique_ptr m_debugger; 29 | }; 30 | } // namespace Win32 31 | } // namespace HoloJs 32 | -------------------------------------------------------------------------------- /windows/src/win32-component/win32-spatial-input.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../host-interfaces.h" 3 | #include "win32-spatial-input.h" 4 | #include "holojs/private/script-host-utilities.h" 5 | #include <..\um\SpatialInteractionManagerInterop.h> 6 | #include <..\winrt\WinRTBase.h> 7 | #include 8 | #include 9 | 10 | using namespace Windows::UI::Input::Spatial; 11 | using namespace std::placeholders; 12 | using namespace Microsoft::WRL; 13 | using namespace Microsoft::WRL::Wrappers; 14 | using namespace Windows::Foundation; 15 | using namespace HoloJs::Interfaces; 16 | using namespace std; 17 | using namespace HoloJs::Win32; 18 | 19 | HRESULT Win32SpatialInput::createSpatialInteractionManager() 20 | { 21 | ComPtr spSpatialInteractionManagerStatics; 22 | 23 | RETURN_IF_FAILED(ABI::Windows::Foundation::GetActivationFactory( 24 | HStringReference(RuntimeClass_Windows_UI_Input_Spatial_SpatialInteractionManager).Get(), 25 | &spSpatialInteractionManagerStatics)); 26 | 27 | ComPtr spSpatialInteractionManagerInterop; 28 | RETURN_IF_FAILED(spSpatialInteractionManagerStatics.As(&spSpatialInteractionManagerInterop)); 29 | 30 | ComPtr spatialInteractionManagerWin32; 31 | RETURN_IF_FAILED(spSpatialInteractionManagerInterop->GetForWindow( 32 | m_window, 33 | __uuidof(ABI::Windows::UI::Input::Spatial::ISpatialInteractionManager), 34 | &spatialInteractionManagerWin32)); 35 | 36 | m_spatialInteractionManager = safe_cast( 37 | reinterpret_cast(spatialInteractionManagerWin32.Get())); 38 | 39 | return S_OK; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /windows/src/win32-component/win32-spatial-input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "holojs/windows/mixed-reality/spatial-input.h" 4 | 5 | namespace HoloJs { 6 | namespace Win32 { 7 | class Win32SpatialInput : public HoloJs::MixedReality::Input::SpatialInput { 8 | public: 9 | Win32SpatialInput() {} 10 | ~Win32SpatialInput() {} 11 | 12 | protected: 13 | 14 | virtual HRESULT createSpatialInteractionManager(); 15 | }; 16 | } // namespace Win32 17 | } // namespace HoloJs -------------------------------------------------------------------------------- /windows/utilities/spin/media/attractor-parameters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/media/attractor-parameters.png -------------------------------------------------------------------------------- /windows/utilities/spin/media/logo-black-background.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/media/logo-black-background.ico -------------------------------------------------------------------------------- /windows/utilities/spin/media/logo-black-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/media/logo-black-background.png -------------------------------------------------------------------------------- /windows/utilities/spin/media/logo-black-background.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/media/logo-black-background.psd -------------------------------------------------------------------------------- /windows/utilities/spin/media/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/media/logo.ico -------------------------------------------------------------------------------- /windows/utilities/spin/media/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/media/logo.png -------------------------------------------------------------------------------- /windows/utilities/spin/media/logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/media/logo.psd -------------------------------------------------------------------------------- /windows/utilities/spin/media/store-poster-viewer.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/media/store-poster-viewer.psd -------------------------------------------------------------------------------- /windows/utilities/spin/media/store-poster.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/media/store-poster.psd -------------------------------------------------------------------------------- /windows/utilities/spin/media/viewer-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/media/viewer-logo.png -------------------------------------------------------------------------------- /windows/utilities/spin/spin-certificate.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/spin-certificate.cer -------------------------------------------------------------------------------- /windows/utilities/spin/spin/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /windows/utilities/spin/spin/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /windows/utilities/spin/spin/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HoloJs.Spin.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /windows/utilities/spin/spin/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /windows/utilities/spin/spin/QrConnect.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | using System.Windows.Data; 10 | using System.Windows.Documents; 11 | using System.Windows.Input; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Shapes; 15 | using ZXing; 16 | 17 | namespace HoloJs.Spin 18 | { 19 | /// 20 | /// Interaction logic for QrConnect.xaml 21 | /// 22 | public partial class QrConnect : Window 23 | { 24 | public QrConnect() 25 | { 26 | InitializeComponent(); 27 | } 28 | 29 | public void SetUrl(string url) 30 | { 31 | var bitmapRenderer = new ZXing.Rendering.WriteableBitmapRenderer(); 32 | bitmapRenderer.Background = System.Windows.Media.Colors.White; 33 | bitmapRenderer.Foreground = System.Windows.Media.Colors.Black; 34 | 35 | ZXing.BarcodeWriterPixelData qrWriter = new ZXing.BarcodeWriterPixelData() 36 | { 37 | Format = BarcodeFormat.QR_CODE, 38 | Options = new ZXing.Common.EncodingOptions() 39 | { 40 | Height = 1024, 41 | Width = 1024 42 | } 43 | }; 44 | 45 | var bitmap = bitmapRenderer.Render(qrWriter.Encode(url), BarcodeFormat.QR_CODE, url); 46 | 47 | QrImage.Source = bitmap; 48 | 49 | UrlText.Text = "spin.exe --uri " + url; 50 | } 51 | 52 | private void CopyToClipboard_Click(object sender, RoutedEventArgs e) 53 | { 54 | Clipboard.SetText(UrlText.Text); 55 | } 56 | 57 | private void EmbeddedUrl_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) 58 | { 59 | Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); 60 | e.Handled = true; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /windows/utilities/spin/spin/logo-black-background.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/spin/logo-black-background.ico -------------------------------------------------------------------------------- /windows/utilities/spin/spin/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /windows/utilities/spin/spin/templates/three_template.js: -------------------------------------------------------------------------------- 1 | var camera, scene, renderer; 2 | 3 | function init() { 4 | let canvas = document.createElement('canvasvr'); 5 | 6 | renderer = new THREE.WebGLRenderer({ canvas, antialias: true }); 7 | renderer.setPixelRatio(window.devicePixelRatio); 8 | renderer.setSize(window.innerWidth, window.innerHeight); 9 | renderer.setAnimationLoop(render); 10 | 11 | window.addEventListener('resize', onWindowResize, false); 12 | 13 | camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.2, 1000); 14 | camera.position.set(0, 1, 0); 15 | 16 | scene = new THREE.Scene(); 17 | 18 | let geometry = new THREE.BoxBufferGeometry(0.3, 0.3, 0.3); 19 | let material = new THREE.MeshBasicMaterial({ color : 0xff0000 }); 20 | let cube = new THREE.Mesh(geometry, material); 21 | cube.position.z = -1.5; 22 | cube.position.y = 1.6; 23 | scene.add(cube); 24 | 25 | // Enter immersive mode if available 26 | navigator.getVRDisplays().then( 27 | function (value) { 28 | if (value.length > 0) { 29 | renderer.vr.enabled = true; 30 | renderer.vr.setDevice(value[0]); 31 | value[0].requestPresent([{ source: renderer.domElement }]); 32 | } 33 | }); 34 | } 35 | 36 | function onWindowResize() { 37 | camera.aspect = window.innerWidth / window.innerHeight; 38 | camera.updateProjectionMatrix(); 39 | renderer.setSize(window.innerWidth, window.innerHeight); 40 | } 41 | 42 | function render() { 43 | renderer.render(scene, camera); 44 | } 45 | 46 | init(); -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/App.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace concurrency; 6 | using namespace Windows::ApplicationModel; 7 | using namespace Windows::ApplicationModel::Core; 8 | using namespace Windows::ApplicationModel::Activation; 9 | using namespace Windows::UI::Core; 10 | using namespace Windows::UI::Input; 11 | using namespace Windows::System; 12 | using namespace Windows::Foundation; 13 | using namespace Windows::Graphics::Display; 14 | 15 | // The main function is only used to initialize our IFrameworkView class. 16 | [Platform::MTAThread] 17 | int main(Platform::Array^) 18 | { 19 | auto scriptHost = ref new HoloJs::UWP::HoloJsScriptHost(); 20 | auto config = ref new HoloJs::UWP::ViewConfiguration(); 21 | 22 | std::wstring deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily->Data(); 23 | if (_wcsicmp(deviceFamily.c_str(), L"Windows.Holographic") == 0) { 24 | config->enableQrCodeNavigation(); 25 | } 26 | 27 | config->enableVoiceCommands(); 28 | 29 | if (scriptHost->initialize(config)) { 30 | scriptHost->startWithEmptyApp(); 31 | } 32 | 33 | return 0; 34 | } -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/LargeTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/LargeTile.scale-100.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/LargeTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/LargeTile.scale-125.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/LargeTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/LargeTile.scale-150.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/LargeTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/LargeTile.scale-200.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/LargeTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/LargeTile.scale-400.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/SmallTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/SmallTile.scale-100.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/SmallTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/SmallTile.scale-125.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/SmallTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/SmallTile.scale-150.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/SmallTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/SmallTile.scale-200.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/SmallTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/SmallTile.scale-400.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/SplashScreen.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/SplashScreen.scale-125.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/SplashScreen.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/SplashScreen.scale-150.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square150x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square150x150Logo.scale-125.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square150x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square150x150Logo.scale-150.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.altform-unplated_targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.altform-unplated_targetsize-32.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.scale-125.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.scale-150.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.targetsize-24.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.targetsize-32.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/StoreLogo.backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/StoreLogo.backup.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/StoreLogo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/StoreLogo.scale-125.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/StoreLogo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/StoreLogo.scale-150.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/StoreLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/StoreLogo.scale-200.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/StoreLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/StoreLogo.scale-400.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Wide310x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Wide310x150Logo.scale-125.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Wide310x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Wide310x150Logo.scale-150.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/Assets/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/HoloJS/f59cbcc252a504db846bab5f331f5a6e23d1cec8/windows/utilities/spin/viewer/Assets/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/_pkginfo.txt: -------------------------------------------------------------------------------- 1 | E:\src\HoloJS\windows\utilities\spin\out\Release\x64\viewer\Upload\viewer_1.0.19.0\viewer_1.0.19.0_x86_x64.appxbundle 2 | -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /windows/utilities/spin/viewer/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include -------------------------------------------------------------------------------- /windows/utilities/webgl-code-generator/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /windows/utilities/webgl-code-generator/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /windows/utilities/webgl-code-generator/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace webgl_code_generator 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /windows/utilities/webgl-code-generator/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 |