├── .github ├── FUNDING.yml ├── img_01.png └── img_02.png ├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── driver.vrdrivermanifest ├── driver_kinectV2.sln ├── driver_kinectV2 ├── CDriverConfig.cpp ├── CDriverConfig.h ├── CEmulatedDevice.cpp ├── CEmulatedDevice.h ├── CJointFilter.cpp ├── CJointFilter.h ├── CKinectHandler.cpp ├── CKinectHandler.h ├── CKinectStation.cpp ├── CKinectStation.h ├── CServerDriver.cpp ├── CServerDriver.h ├── CTrackerVive.cpp ├── CTrackerVive.h ├── MathUtils.cpp ├── MathUtils.h ├── dllmain.cpp ├── driver_kinectV2.vcxproj ├── driver_kinectV2.vcxproj.filters ├── driver_kinectV2.vcxproj.user ├── stdafx.cpp └── stdafx.h ├── kinect_dash ├── Core │ ├── Core.cpp │ └── Core.h ├── Gui │ ├── GuiButton.cpp │ ├── GuiButton.h │ ├── GuiCheckbox.cpp │ ├── GuiCheckbox.h │ ├── GuiElement.cpp │ ├── GuiElement.h │ ├── GuiInputText.cpp │ ├── GuiInputText.h │ ├── GuiLabel.cpp │ ├── GuiLabel.h │ ├── GuiRadioButton.cpp │ ├── GuiRadioButton.h │ ├── GuiScreen.cpp │ ├── GuiScreen.h │ ├── GuiSeparator.cpp │ ├── GuiSeparator.h │ ├── GuiText.cpp │ ├── GuiText.h │ ├── GuiWindow.cpp │ └── GuiWindow.h ├── Managers │ ├── CalibrationHelper.cpp │ ├── CalibrationHelper.h │ ├── ConfigManager.cpp │ ├── ConfigManager.h │ ├── GuiManager.cpp │ ├── GuiManager.h │ ├── SfmlManager.cpp │ ├── SfmlManager.h │ ├── VRManager.cpp │ └── VRManager.h ├── base.ico ├── kinect_dash.rc ├── kinect_dash.vcxproj ├── kinect_dash.vcxproj.filters ├── kinect_dash.vcxproj.user ├── main.cpp ├── resource.h ├── stdafx.cpp └── stdafx.h ├── resources ├── fonts │ ├── Hack-Regular.ttf │ └── LICENSE.md ├── icons │ ├── base.png │ ├── base_status_error.png │ ├── base_status_error@2x.png │ ├── base_status_off.png │ ├── base_status_off@2x.png │ ├── base_status_ready.png │ ├── base_status_ready@2x.png │ ├── base_status_ready_alert.png │ ├── base_status_ready_alert@2x.png │ ├── base_status_searching.png │ ├── base_status_searching@2x.png │ ├── base_status_searching_alert.png │ ├── base_status_searching_alert@2x.png │ ├── base_status_standby.png │ └── base_status_standby@2x.png ├── rendermodels │ └── kinect_sensor_2_0 │ │ ├── bake_base.png │ │ ├── kinect_sensor_2_0.json │ │ ├── kinect_sensor_2_0.mtl │ │ ├── kinect_sensor_2_0.obj │ │ └── thumbnail_kinect.png └── settings.xml ├── shared ├── Utils.cpp └── Utils.h └── vendor └── SFML ├── bin ├── win32 │ ├── sfml-graphics-2.dll │ ├── sfml-graphics-d-2.dll │ ├── sfml-system-2.dll │ ├── sfml-system-d-2.dll │ ├── sfml-window-2.dll │ └── sfml-window-d-2.dll └── win64 │ ├── sfml-graphics-2.dll │ ├── sfml-graphics-d-2.dll │ ├── sfml-system-2.dll │ ├── sfml-system-d-2.dll │ ├── sfml-window-2.dll │ └── sfml-window-d-2.dll ├── include └── SFML │ ├── Audio.hpp │ ├── Audio │ ├── AlResource.hpp │ ├── Export.hpp │ ├── InputSoundFile.hpp │ ├── Listener.hpp │ ├── Music.hpp │ ├── OutputSoundFile.hpp │ ├── Sound.hpp │ ├── SoundBuffer.hpp │ ├── SoundBufferRecorder.hpp │ ├── SoundFileFactory.hpp │ ├── SoundFileFactory.inl │ ├── SoundFileReader.hpp │ ├── SoundFileWriter.hpp │ ├── SoundRecorder.hpp │ ├── SoundSource.hpp │ └── SoundStream.hpp │ ├── Config.hpp │ ├── GpuPreference.hpp │ ├── Graphics.hpp │ ├── Graphics │ ├── BlendMode.hpp │ ├── CircleShape.hpp │ ├── Color.hpp │ ├── ConvexShape.hpp │ ├── Drawable.hpp │ ├── Export.hpp │ ├── Font.hpp │ ├── Glsl.hpp │ ├── Glsl.inl │ ├── Glyph.hpp │ ├── Image.hpp │ ├── PrimitiveType.hpp │ ├── Rect.hpp │ ├── Rect.inl │ ├── RectangleShape.hpp │ ├── RenderStates.hpp │ ├── RenderTarget.hpp │ ├── RenderTexture.hpp │ ├── RenderWindow.hpp │ ├── Shader.hpp │ ├── Shape.hpp │ ├── Sprite.hpp │ ├── Text.hpp │ ├── Texture.hpp │ ├── Transform.hpp │ ├── Transformable.hpp │ ├── Vertex.hpp │ ├── VertexArray.hpp │ ├── VertexBuffer.hpp │ └── View.hpp │ ├── Main.hpp │ ├── Network.hpp │ ├── Network │ ├── Export.hpp │ ├── Ftp.hpp │ ├── Http.hpp │ ├── IpAddress.hpp │ ├── Packet.hpp │ ├── Socket.hpp │ ├── SocketHandle.hpp │ ├── SocketSelector.hpp │ ├── TcpListener.hpp │ ├── TcpSocket.hpp │ └── UdpSocket.hpp │ ├── OpenGL.hpp │ ├── System.hpp │ ├── System │ ├── Clock.hpp │ ├── Err.hpp │ ├── Export.hpp │ ├── FileInputStream.hpp │ ├── InputStream.hpp │ ├── Lock.hpp │ ├── MemoryInputStream.hpp │ ├── Mutex.hpp │ ├── NativeActivity.hpp │ ├── NonCopyable.hpp │ ├── Sleep.hpp │ ├── String.hpp │ ├── String.inl │ ├── Thread.hpp │ ├── Thread.inl │ ├── ThreadLocal.hpp │ ├── ThreadLocalPtr.hpp │ ├── ThreadLocalPtr.inl │ ├── Time.hpp │ ├── Utf.hpp │ ├── Utf.inl │ ├── Vector2.hpp │ ├── Vector2.inl │ ├── Vector3.hpp │ └── Vector3.inl │ ├── Window.hpp │ └── Window │ ├── Clipboard.hpp │ ├── Context.hpp │ ├── ContextSettings.hpp │ ├── Cursor.hpp │ ├── Event.hpp │ ├── Export.hpp │ ├── GlResource.hpp │ ├── Joystick.hpp │ ├── Keyboard.hpp │ ├── Mouse.hpp │ ├── Sensor.hpp │ ├── Touch.hpp │ ├── VideoMode.hpp │ ├── Window.hpp │ ├── WindowHandle.hpp │ └── WindowStyle.hpp ├── lib ├── win32 │ ├── sfml-graphics-d.lib │ ├── sfml-graphics.lib │ ├── sfml-main-d.lib │ ├── sfml-main.lib │ ├── sfml-system-d.lib │ ├── sfml-system.lib │ ├── sfml-window-d.lib │ └── sfml-window.lib └── win64 │ ├── sfml-graphics-d.lib │ ├── sfml-graphics.lib │ ├── sfml-main-d.lib │ ├── sfml-main.lib │ ├── sfml-system-d.lib │ ├── sfml-system.lib │ ├── sfml-window-d.lib │ └── sfml-window.lib ├── license.md ├── notice.txt └── readme.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: sdraw_ 2 | -------------------------------------------------------------------------------- /.github/img_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/.github/img_01.png -------------------------------------------------------------------------------- /.github/img_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/.github/img_02.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | 9 | # Precompiled Headers 10 | *.gch 11 | *.pch 12 | 13 | # Compiled Dynamic libraries 14 | *.so 15 | *.dylib 16 | 17 | # Fortran module files 18 | *.mod 19 | *.smod 20 | 21 | # Compiled Static libraries 22 | *.lai 23 | *.la 24 | *.a 25 | 26 | # Executables 27 | *.exe 28 | *.out 29 | *.app 30 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vendor/glm"] 2 | path = vendor/glm 3 | url = https://github.com/g-truc/glm.git 4 | [submodule "vendor/pugixml"] 5 | path = vendor/pugixml 6 | url = https://github.com/zeux/pugixml.git 7 | [submodule "vendor/openvr"] 8 | path = vendor/openvr 9 | url = https://github.com/ValveSoftware/openvr.git 10 | [submodule "vendor/imgui"] 11 | path = vendor/imgui 12 | url = https://github.com/ocornut/imgui.git 13 | [submodule "vendor/imgui-sfml"] 14 | path = vendor/imgui-sfml 15 | url = https://github.com/eliasdaler/imgui-sfml.git 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 SDraw 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Driver KinectV2 [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) 2 | 3 | SteamVR driver for Kinect for XBox One / Kinect 2 for Windows. 4 | 5 | ![](./.github/img_02.png) 6 | 7 | ## Features 8 | * No additional dependencies for SteamVR. 9 | * Configurable motion smoothing. 10 | * Configurable amount of trackers assigned to bones. 11 | * Works on Windows 8/8.1 and Windows 10. 12 | 13 | ## Installation 14 | * Install [Kinect for Windows Runtime 2.0](https://www.microsoft.com/en-us/download/details.aspx?id=44559) or [Kinect for Windows SDK 2.0](https://www.microsoft.com/en-us/download/details.aspx?id=44561). 15 | * Extract [latest release archive](../../releases/latest) to `/drivers` 16 | * Add line in section `steamvr` of `/config/steamvr.vrsettings` file: 17 | ```JSON 18 | "activateMultipleDrivers": true, 19 | ``` 20 | 21 | ## Dashboard 22 | ![](./.github/img_01.png) 23 | Open `KinectV2 Dashboard` from SteamVR dashboard to gain access to available settings for users: 24 | * **Trackers toggle:** Allows you to toggle trackers for specific bones. 25 | * **Calibration info:** Shows transformation of root point of trackers. 26 | * **Settings:** 27 | * **Calibration:** Enables changing transformation of root point. After click close SteamVR dashboard and use your controllers to change rotation and position to allign trackers with your assigned body parts: 28 | * **Left controller's touchpad/thumbstick:** Rotate left, rotate right, rotate up, rotate down. Press grip to reset rotation. 29 | * **Right controller's touchpad/thumbstick:** Move right, move left, move up, move down. Press grip to reset position. 30 | * If trigger is pressed: move forward, move backward. 31 | * **Application menu button on any controller:** End calibration and save alligned base transformation. 32 | * **Toggle tracking:** Disable or enable tracking entirely. 33 | * **Interpolation type:** Sets specific interpolation between Kinect frames. More info is available at [Wikipedia's article](https://en.wikipedia.org/wiki/Interpolation). 34 | * **Kinect relay device state:** Shows if specific virtual base station is present. 35 | 36 | ## Building 37 | * Install [Kinect for Windows SDK 2.0](https://www.microsoft.com/en-us/download/details.aspx?id=44561). 38 | * Clone repository using `git`. 39 | * Initialize submodules 40 | ``` 41 | git submodule update --init --depth=1 42 | ``` 43 | * Open `driver_kinectV2.sln` in Visual Studio 2013. 44 | -------------------------------------------------------------------------------- /driver.vrdrivermanifest: -------------------------------------------------------------------------------- 1 | { 2 | "alwaysActivate": true, 3 | "name" : "kinectV2", 4 | "directory" : "", 5 | "resourceOnly" : false 6 | } 7 | -------------------------------------------------------------------------------- /driver_kinectV2.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "driver_kinectV2", "driver_kinectV2\driver_kinectV2.vcxproj", "{219CF32C-0CD5-471A-8075-108B62BB61E3}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kinect_dash", "kinect_dash\kinect_dash.vcxproj", "{1931F8CB-44F8-4D6E-A40D-C5AC57332CB0}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|x64 = Debug|x64 13 | Debug|x86 = Debug|x86 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {219CF32C-0CD5-471A-8075-108B62BB61E3}.Debug|x64.ActiveCfg = Debug|x64 19 | {219CF32C-0CD5-471A-8075-108B62BB61E3}.Debug|x64.Build.0 = Debug|x64 20 | {219CF32C-0CD5-471A-8075-108B62BB61E3}.Debug|x86.ActiveCfg = Debug|Win32 21 | {219CF32C-0CD5-471A-8075-108B62BB61E3}.Debug|x86.Build.0 = Debug|Win32 22 | {219CF32C-0CD5-471A-8075-108B62BB61E3}.Release|x64.ActiveCfg = Release|x64 23 | {219CF32C-0CD5-471A-8075-108B62BB61E3}.Release|x64.Build.0 = Release|x64 24 | {219CF32C-0CD5-471A-8075-108B62BB61E3}.Release|x86.ActiveCfg = Release|Win32 25 | {219CF32C-0CD5-471A-8075-108B62BB61E3}.Release|x86.Build.0 = Release|Win32 26 | {1931F8CB-44F8-4D6E-A40D-C5AC57332CB0}.Debug|x64.ActiveCfg = Debug|x64 27 | {1931F8CB-44F8-4D6E-A40D-C5AC57332CB0}.Debug|x64.Build.0 = Debug|x64 28 | {1931F8CB-44F8-4D6E-A40D-C5AC57332CB0}.Debug|x86.ActiveCfg = Debug|Win32 29 | {1931F8CB-44F8-4D6E-A40D-C5AC57332CB0}.Debug|x86.Build.0 = Debug|Win32 30 | {1931F8CB-44F8-4D6E-A40D-C5AC57332CB0}.Release|x64.ActiveCfg = Release|x64 31 | {1931F8CB-44F8-4D6E-A40D-C5AC57332CB0}.Release|x64.Build.0 = Release|x64 32 | {1931F8CB-44F8-4D6E-A40D-C5AC57332CB0}.Release|x86.ActiveCfg = Release|Win32 33 | {1931F8CB-44F8-4D6E-A40D-C5AC57332CB0}.Release|x86.Build.0 = Release|Win32 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /driver_kinectV2/CDriverConfig.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "CDriverConfig.h" 4 | 5 | #include "Utils.h" 6 | 7 | extern char g_modulePath[]; 8 | 9 | const std::vector g_settingNames 10 | { 11 | "basePosition", "baseRotation", "interpolation", "trackers" 12 | }; 13 | 14 | enum SettingIndex : size_t 15 | { 16 | SI_BasePosition = 0U, 17 | SI_BaseRotation, 18 | SI_Interpolation, 19 | SI_Trackers 20 | }; 21 | 22 | const std::vector g_interpolationTypes 23 | { 24 | "linear", "quadratic", "cubic", "quartic", "quintic", "exponential", "sine", "circular" 25 | }; 26 | 27 | const std::vector g_boneNames 28 | { 29 | "SpineBase", "SpineMid", "Neck", "Head", 30 | "ShoulderLeft", "ElbowLeft", "WristLeft", "HandLeft", 31 | "ShoulderRight", "ElbowRight", "WristRight", "HandRight", 32 | "HipLeft", "KneeLeft", "AnkleLeft", "FootLeft", 33 | "HipRight", "KneeRight", "AnkleRight", "FootRight", 34 | "SpineShoulder", 35 | "HandTipLeft", "ThumbLeft", 36 | "HandTipRight", "ThumbRight" 37 | }; 38 | 39 | glm::vec3 CDriverConfig::ms_basePosition(0.f); 40 | glm::quat CDriverConfig::ms_baseRotation(1.f, 0.f, 0.f, 0.f); 41 | unsigned char CDriverConfig::ms_interpolation = CDriverConfig::FI_Linear; 42 | bool CDriverConfig::ms_trackingState = true; 43 | std::vector CDriverConfig::ms_boneIndexes; 44 | 45 | void CDriverConfig::Load() 46 | { 47 | std::string l_path(g_modulePath); 48 | l_path.erase(l_path.begin() + l_path.rfind('\\'), l_path.end()); 49 | l_path.append("\\..\\..\\resources\\settings.xml"); 50 | 51 | pugi::xml_document *l_settings = new pugi::xml_document(); 52 | if(l_settings->load_file(l_path.c_str())) 53 | { 54 | const pugi::xml_node l_root = l_settings->child("settings"); 55 | if(l_root) 56 | { 57 | for(pugi::xml_node l_node = l_root.child("setting"); l_node; l_node = l_node.next_sibling("setting")) 58 | { 59 | const pugi::xml_attribute l_attribName = l_node.attribute("name"); 60 | const pugi::xml_attribute l_attribValue = l_node.attribute("value"); 61 | if(l_attribName && l_attribValue) 62 | { 63 | switch(ReadEnumVector(l_attribName.as_string(), g_settingNames)) 64 | { 65 | case SettingIndex::SI_BasePosition: 66 | { 67 | std::stringstream l_stream(l_attribValue.as_string("0.0 0.0 0.0")); 68 | l_stream >> ms_basePosition.x >> ms_basePosition.y >> ms_basePosition.z; 69 | } break; 70 | 71 | case SettingIndex::SI_BaseRotation: 72 | { 73 | std::stringstream l_stream(l_attribValue.as_string("0.0 0.0 0.0 1.0")); 74 | l_stream >> ms_baseRotation.x >> ms_baseRotation.y >> ms_baseRotation.z >> ms_baseRotation.w; 75 | } break; 76 | 77 | case SettingIndex::SI_Interpolation: 78 | { 79 | size_t l_interpolation = ReadEnumVector(l_attribValue.as_string("linear"), g_interpolationTypes); 80 | if(l_interpolation != std::numeric_limits::max()) ms_interpolation = static_cast(l_interpolation); 81 | } break; 82 | 83 | case SettingIndex::SI_Trackers: 84 | { 85 | ms_trackingState = l_attribValue.as_bool(true); 86 | for(pugi::xml_node l_trackerNode = l_node.child("tracker"); l_trackerNode; l_trackerNode = l_trackerNode.next_sibling("tracker")) 87 | { 88 | const pugi::xml_attribute l_attribBone = l_trackerNode.attribute("name"); 89 | const pugi::xml_attribute l_attribEnabled = l_trackerNode.attribute("value"); 90 | if(l_attribBone && l_attribEnabled) 91 | { 92 | size_t l_boneIndex = ReadEnumVector(l_attribBone.as_string(), g_boneNames); 93 | if(l_boneIndex != std::numeric_limits::max()) 94 | { 95 | if(l_attribEnabled.as_bool(false)) ms_boneIndexes.push_back(l_boneIndex); 96 | } 97 | } 98 | } 99 | } break; 100 | } 101 | } 102 | } 103 | } 104 | } 105 | 106 | delete l_settings; 107 | 108 | // Remove duplicated bones 109 | std::sort(ms_boneIndexes.begin(), ms_boneIndexes.end()); 110 | ms_boneIndexes.erase(std::unique(ms_boneIndexes.begin(), ms_boneIndexes.end()), ms_boneIndexes.end()); 111 | } 112 | 113 | const glm::vec3& CDriverConfig::GetBasePosition() 114 | { 115 | return ms_basePosition; 116 | } 117 | 118 | const glm::quat& CDriverConfig::GetBaseRotation() 119 | { 120 | return ms_baseRotation; 121 | } 122 | 123 | unsigned char CDriverConfig::GetInterpolation() 124 | { 125 | return ms_interpolation; 126 | } 127 | 128 | bool CDriverConfig::GetTrackingState() 129 | { 130 | return ms_trackingState; 131 | } 132 | 133 | const std::vector& CDriverConfig::GetBoneIndexes() 134 | { 135 | return ms_boneIndexes; 136 | } 137 | -------------------------------------------------------------------------------- /driver_kinectV2/CDriverConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CDriverConfig final 4 | { 5 | static glm::vec3 ms_basePosition; 6 | static glm::quat ms_baseRotation; 7 | static unsigned char ms_interpolation; 8 | static bool ms_trackingState; 9 | static std::vector ms_boneIndexes; 10 | public: 11 | enum FrameInterpolation : unsigned char 12 | { 13 | FI_Linear = 0U, 14 | FI_Quadratic, 15 | FI_Cubic, 16 | FI_Quartic, 17 | FI_Quintic, 18 | FI_Exponential, 19 | FI_Sine, 20 | FI_Circular 21 | }; 22 | 23 | static void Load(); 24 | 25 | static const glm::vec3& GetBasePosition(); 26 | static const glm::quat& GetBaseRotation(); 27 | static unsigned char GetInterpolation(); 28 | static const std::vector& GetBoneIndexes(); 29 | static bool GetTrackingState(); 30 | }; 31 | -------------------------------------------------------------------------------- /driver_kinectV2/CEmulatedDevice.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "CEmulatedDevice.h" 4 | 5 | CEmulatedDevice::CEmulatedDevice() 6 | { 7 | m_connected = false; 8 | m_forcedConnected = true; 9 | 10 | m_pose = { 0 }; 11 | m_pose.poseTimeOffset = -0.011; 12 | m_pose.qWorldFromDriverRotation.w = 1.0; 13 | m_pose.qWorldFromDriverRotation.x = .0; 14 | m_pose.qWorldFromDriverRotation.y = .0; 15 | m_pose.qWorldFromDriverRotation.z = .0; 16 | m_pose.qDriverFromHeadRotation.w = 1.0; 17 | m_pose.qDriverFromHeadRotation.x = .0; 18 | m_pose.qDriverFromHeadRotation.y = .0; 19 | m_pose.qDriverFromHeadRotation.z = .0; 20 | m_pose.vecDriverFromHeadTranslation[0U] = .0; 21 | m_pose.vecDriverFromHeadTranslation[1U] = .0; 22 | m_pose.vecDriverFromHeadTranslation[2U] = .0; 23 | m_pose.poseIsValid = false; 24 | m_pose.willDriftInYaw = false; 25 | m_pose.shouldApplyHeadModel = false; 26 | m_pose.result = vr::TrackingResult_Uninitialized; 27 | m_pose.deviceIsConnected = false; 28 | 29 | m_propertyHandle = vr::k_ulInvalidPropertyContainer; 30 | m_trackedDevice = vr::k_unTrackedDeviceIndexInvalid; 31 | } 32 | 33 | CEmulatedDevice::~CEmulatedDevice() 34 | { 35 | } 36 | 37 | // vr::ITrackedDeviceServerDriver 38 | vr::EVRInitError CEmulatedDevice::Activate(uint32_t unObjectId) 39 | { 40 | vr::EVRInitError l_error = vr::VRInitError_Driver_Failed; 41 | 42 | if(m_trackedDevice == vr::k_unTrackedDeviceIndexInvalid) 43 | { 44 | m_trackedDevice = unObjectId; 45 | m_propertyHandle = vr::VRProperties()->TrackedDeviceToPropertyContainer(m_trackedDevice); 46 | 47 | SetupProperties(); 48 | 49 | m_connected = true; 50 | m_pose.deviceIsConnected = (m_connected && m_forcedConnected); 51 | m_pose.poseIsValid = true; 52 | m_pose.result = vr::TrackingResult_Running_OK; 53 | 54 | l_error = vr::VRInitError_None; 55 | } 56 | 57 | return l_error; 58 | } 59 | 60 | void CEmulatedDevice::Deactivate() 61 | { 62 | m_trackedDevice = vr::k_unTrackedDeviceIndexInvalid; 63 | } 64 | 65 | void CEmulatedDevice::EnterStandby() 66 | { 67 | } 68 | 69 | void* CEmulatedDevice::GetComponent(const char* pchComponentNameAndVersion) 70 | { 71 | void *l_result = nullptr; 72 | if(!strcmp(pchComponentNameAndVersion, vr::ITrackedDeviceServerDriver_Version)) l_result = dynamic_cast(this); 73 | return l_result; 74 | } 75 | 76 | void CEmulatedDevice::DebugRequest(const char* pchRequest, char* pchResponseBuffer, uint32_t unResponseBufferSize) 77 | { 78 | } 79 | 80 | vr::DriverPose_t CEmulatedDevice::GetPose() 81 | { 82 | return m_pose; 83 | } 84 | 85 | // CEmulatedDevice 86 | const std::string& CEmulatedDevice::GetSerial() const 87 | { 88 | return m_serial; 89 | } 90 | 91 | bool CEmulatedDevice::IsConnected() const 92 | { 93 | return m_connected; 94 | } 95 | 96 | void CEmulatedDevice::SetConnected(bool p_state) 97 | { 98 | m_connected = p_state; 99 | m_pose.deviceIsConnected = (m_connected && m_forcedConnected); 100 | } 101 | 102 | void CEmulatedDevice::SetForcedConnected(bool p_state) 103 | { 104 | m_forcedConnected = p_state; 105 | m_pose.deviceIsConnected = (m_connected && m_forcedConnected); 106 | } 107 | 108 | void CEmulatedDevice::SetPosition(float p_x, float p_y, float p_z) 109 | { 110 | m_pose.vecPosition[0U] = p_x; 111 | m_pose.vecPosition[1U] = p_y; 112 | m_pose.vecPosition[2U] = p_z; 113 | } 114 | 115 | void CEmulatedDevice::SetRotation(float p_x, float p_y, float p_z, float p_w) 116 | { 117 | m_pose.qRotation.x = p_x; 118 | m_pose.qRotation.y = p_y; 119 | m_pose.qRotation.z = p_z; 120 | m_pose.qRotation.w = p_w; 121 | } 122 | 123 | void CEmulatedDevice::SetOffsetPosition(float p_x, float p_y, float p_z) 124 | { 125 | m_pose.vecWorldFromDriverTranslation[0U] = p_x; 126 | m_pose.vecWorldFromDriverTranslation[1U] = p_y; 127 | m_pose.vecWorldFromDriverTranslation[2U] = p_z; 128 | } 129 | 130 | void CEmulatedDevice::SetOffsetRotation(float p_x, float p_y, float p_z, float p_w) 131 | { 132 | m_pose.qWorldFromDriverRotation.x = p_x; 133 | m_pose.qWorldFromDriverRotation.y = p_y; 134 | m_pose.qWorldFromDriverRotation.z = p_z; 135 | m_pose.qWorldFromDriverRotation.w = p_w; 136 | } 137 | 138 | void CEmulatedDevice::SetupProperties() 139 | { 140 | } 141 | 142 | void CEmulatedDevice::RunFrame() 143 | { 144 | if(m_trackedDevice != vr::k_unTrackedDeviceIndexInvalid) 145 | { 146 | vr::VRServerDriverHost()->TrackedDevicePoseUpdated(m_trackedDevice, m_pose, sizeof(vr::DriverPose_t)); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /driver_kinectV2/CEmulatedDevice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CEmulatedDevice : public vr::ITrackedDeviceServerDriver 4 | { 5 | vr::DriverPose_t m_pose; 6 | bool m_connected; 7 | bool m_forcedConnected; 8 | 9 | CEmulatedDevice(const CEmulatedDevice &that) = delete; 10 | CEmulatedDevice& operator=(const CEmulatedDevice &that) = delete; 11 | 12 | // vr::ITrackedDeviceServerDriver 13 | vr::EVRInitError Activate(uint32_t unObjectId); 14 | void Deactivate(); 15 | void EnterStandby(); 16 | void* GetComponent(const char* pchComponentNameAndVersion); 17 | void DebugRequest(const char* pchRequest, char* pchResponseBuffer, uint32_t unResponseBufferSize); 18 | vr::DriverPose_t GetPose(); 19 | public: 20 | CEmulatedDevice(); 21 | virtual ~CEmulatedDevice(); 22 | 23 | const std::string& GetSerial() const; 24 | const size_t GetIndex() const; 25 | 26 | bool IsConnected() const; 27 | void SetConnected(bool p_state); 28 | void SetForcedConnected(bool p_state); 29 | 30 | void SetPosition(float p_x, float p_y, float p_z); 31 | void SetRotation(float p_x, float p_y, float p_z, float p_w); 32 | 33 | void SetOffsetPosition(float p_x, float p_y, float p_z); 34 | void SetOffsetRotation(float p_x, float p_y, float p_z, float p_w); 35 | 36 | void RunFrame(); 37 | protected: 38 | vr::PropertyContainerHandle_t m_propertyHandle; 39 | uint32_t m_trackedDevice; 40 | 41 | std::string m_serial; 42 | 43 | virtual void SetupProperties(); 44 | }; 45 | -------------------------------------------------------------------------------- /driver_kinectV2/CJointFilter.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "CJointFilter.h" 4 | 5 | const float CJointFilter::ms_smoothing = 0.25f; 6 | const float CJointFilter::ms_correction = 0.25f; 7 | const float CJointFilter::ms_prediction = 0.25f; 8 | 9 | CJointFilter::CJointFilter() 10 | { 11 | m_maxDeviationRadius = 0.05f; 12 | m_jitterRadius = 0.03f; 13 | m_history.m_rawPosition = glm::vec3(0.f); 14 | m_history.m_filteredPosition = glm::vec3(0.f); 15 | m_history.m_trend = glm::vec3(0.f); 16 | m_history.m_frameCount = 0U; 17 | } 18 | 19 | CJointFilter::~CJointFilter() 20 | { 21 | } 22 | 23 | const glm::vec3& CJointFilter::GetFiltered() const 24 | { 25 | return m_filteredJoint; 26 | } 27 | 28 | void CJointFilter::Update(const Joint &p_joint) 29 | { 30 | if(p_joint.TrackingState == TrackingState::TrackingState_Inferred) 31 | { 32 | m_jitterRadius = 0.06f; 33 | m_maxDeviationRadius = 0.1f; 34 | } 35 | else 36 | { 37 | m_jitterRadius = 0.03f; 38 | m_maxDeviationRadius = 0.05f; 39 | } 40 | 41 | const glm::vec3 l_rawPosition(p_joint.Position.X, p_joint.Position.Y, p_joint.Position.Z); 42 | glm::vec3 l_filteredPosition; 43 | glm::vec3 l_predictedPosition; 44 | glm::vec3 l_diff; 45 | glm::vec3 l_trend; 46 | float l_length; 47 | 48 | // If joint is invalid, reset the filter 49 | if(glm::length(l_rawPosition) == 0.f) m_history.m_frameCount = 0U; 50 | 51 | // Initial start values 52 | if(m_history.m_frameCount == 0U) 53 | { 54 | l_filteredPosition = l_rawPosition; 55 | l_trend = glm::vec3(0.f); 56 | m_history.m_frameCount++; 57 | } 58 | else if(m_history.m_frameCount == 1U) 59 | { 60 | l_filteredPosition = (l_rawPosition + m_history.m_rawPosition)*0.5f; 61 | l_diff = l_filteredPosition - m_history.m_filteredPosition; 62 | l_trend = l_diff*ms_correction + m_history.m_trend*(1.0f - ms_correction); 63 | m_history.m_frameCount++; 64 | } 65 | else 66 | { 67 | // First apply jitter filter 68 | l_diff = l_rawPosition - m_history.m_filteredPosition; 69 | l_length = glm::length(l_diff); 70 | 71 | if(l_length <= m_jitterRadius) l_filteredPosition = l_rawPosition * (l_length / m_jitterRadius) + m_history.m_filteredPosition *(1.0f - l_length / m_jitterRadius); 72 | else l_filteredPosition = l_rawPosition; 73 | 74 | // Now the double exponential smoothing filter 75 | l_filteredPosition = l_filteredPosition * (1.0f - ms_smoothing) + (m_history.m_filteredPosition + m_history.m_trend)*ms_smoothing; 76 | 77 | l_diff = l_filteredPosition - m_history.m_filteredPosition; 78 | l_trend = l_diff*ms_correction + m_history.m_trend*(1.0f - ms_correction); 79 | } 80 | 81 | // Predict into the future to reduce latency 82 | l_predictedPosition = l_filteredPosition + l_trend*ms_prediction; 83 | 84 | // Check that we are not too far away from raw data 85 | l_diff = l_predictedPosition - l_rawPosition; 86 | l_length = glm::length(l_diff); 87 | 88 | if(l_length > m_maxDeviationRadius) 89 | { 90 | l_predictedPosition = l_predictedPosition*(m_maxDeviationRadius / l_length) + l_rawPosition*(1.0f - m_maxDeviationRadius / l_length); 91 | } 92 | 93 | // Save the data from this frame 94 | m_history.m_rawPosition = l_rawPosition; 95 | m_history.m_filteredPosition = l_filteredPosition; 96 | m_history.m_trend = l_trend; 97 | 98 | // Output the data 99 | m_filteredJoint = l_predictedPosition; 100 | } 101 | -------------------------------------------------------------------------------- /driver_kinectV2/CJointFilter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // Modified joint smoothing code from https://social.msdn.microsoft.com/Forums/en-US/045b058a-ae3a-4d01-beb6-b756631b4b42/joint-smoothing-code?forum=kinectv2sdk 3 | 4 | class CJointFilter final 5 | { 6 | struct FilterData 7 | { 8 | glm::vec3 m_rawPosition; 9 | glm::vec3 m_filteredPosition; 10 | glm::vec3 m_trend; 11 | unsigned long m_frameCount; 12 | }; 13 | 14 | static const float ms_smoothing; 15 | static const float ms_correction; 16 | static const float ms_prediction; 17 | float m_jitterRadius; 18 | float m_maxDeviationRadius; 19 | 20 | FilterData m_history; 21 | glm::vec3 m_filteredJoint; 22 | public: 23 | CJointFilter(); 24 | ~CJointFilter(); 25 | 26 | const glm::vec3& GetFiltered() const; 27 | 28 | void Update(const Joint &p_joint); 29 | }; 30 | -------------------------------------------------------------------------------- /driver_kinectV2/CKinectHandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CJointFilter; 4 | struct JointData 5 | { 6 | float x, y, z; 7 | float rx, ry, rz, rw; 8 | }; 9 | struct FrameData 10 | { 11 | JointData m_joints[JointType_Count]; 12 | TIMESPAN m_frameTime; 13 | ULONGLONG m_tick; 14 | }; 15 | 16 | class CKinectHandler final 17 | { 18 | IKinectSensor *m_kinectSensor; 19 | IBodyFrameReader *m_bodyFrameReader; 20 | 21 | CJointFilter *m_jointFilters[JointType_Count]; 22 | FrameData *m_frameData; 23 | 24 | std::atomic m_paused; 25 | 26 | CKinectHandler(const CKinectHandler &that) = delete; 27 | CKinectHandler& operator=(const CKinectHandler &that) = delete; 28 | 29 | void Cleanup(); 30 | public: 31 | explicit CKinectHandler(); 32 | ~CKinectHandler(); 33 | 34 | bool Initialize(); 35 | void Terminate(); 36 | 37 | const FrameData* GetFrameData() const; 38 | 39 | bool IsPaused() const; 40 | void SetPaused(bool p_state); 41 | 42 | void Update(); 43 | }; 44 | -------------------------------------------------------------------------------- /driver_kinectV2/CKinectStation.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "CKinectStation.h" 4 | #include "CServerDriver.h" 5 | 6 | CKinectStation::CKinectStation(CServerDriver *p_server) 7 | { 8 | m_serverDriver = p_server; 9 | m_serial.assign("KS-20"); 10 | } 11 | 12 | CKinectStation::~CKinectStation() 13 | { 14 | } 15 | 16 | void CKinectStation::SetupProperties() 17 | { 18 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_TrackingSystemName_String, "kinect"); 19 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_SerialNumber_String, m_serial.c_str()); 20 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_ModelNumber_String, "Kinect Sensor 2.0"); 21 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_ManufacturerName_String, "Microsoft"); 22 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_ModeLabel_String, "K"); 23 | 24 | vr::VRProperties()->SetInt32Property(m_propertyHandle, vr::Prop_DeviceClass_Int32, vr::TrackedDeviceClass_TrackingReference); 25 | vr::VRProperties()->SetBoolProperty(m_propertyHandle, vr::Prop_IsOnDesktop_Bool, false); 26 | vr::VRProperties()->SetBoolProperty(m_propertyHandle, vr::Prop_NeverTracked_Bool, false); 27 | vr::VRProperties()->SetBoolProperty(m_propertyHandle, vr::Prop_WillDriftInYaw_Bool, false); 28 | vr::VRProperties()->SetBoolProperty(m_propertyHandle, vr::Prop_CanWirelessIdentify_Bool, false); 29 | 30 | vr::VRProperties()->SetFloatProperty(m_propertyHandle, vr::Prop_FieldOfViewLeftDegrees_Float, 70.f); 31 | vr::VRProperties()->SetFloatProperty(m_propertyHandle, vr::Prop_FieldOfViewRightDegrees_Float, 70.f); 32 | vr::VRProperties()->SetFloatProperty(m_propertyHandle, vr::Prop_FieldOfViewTopDegrees_Float, 60.f); 33 | vr::VRProperties()->SetFloatProperty(m_propertyHandle, vr::Prop_FieldOfViewBottomDegrees_Float, 60.f); 34 | vr::VRProperties()->SetFloatProperty(m_propertyHandle, vr::Prop_TrackingRangeMinimumMeters_Float, 0.5f); 35 | vr::VRProperties()->SetFloatProperty(m_propertyHandle, vr::Prop_TrackingRangeMaximumMeters_Float, 4.5f); 36 | 37 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_ResourceRoot_String, "kinectV2"); 38 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_RenderModelName_String, "{kinectV2}kinect_sensor_2_0"); 39 | 40 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_NamedIconPathDeviceOff_String, "{kinectV2}/icons/base_status_off.png"); 41 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_NamedIconPathDeviceSearching_String, "{kinectV2}/icons/base_status_searching.gif"); 42 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_NamedIconPathDeviceSearchingAlert_String, "{kinectV2}/icons/base_status_searching_alert.gif"); 43 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_NamedIconPathDeviceReady_String, "{kinectV2}/icons/base_status_ready.png"); 44 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_NamedIconPathDeviceReadyAlert_String, "{kinectV2}/icons/base_status_ready_alert.png"); 45 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_NamedIconPathDeviceNotReady_String, "{kinectV2}/icons/base_status_error.png"); 46 | vr::VRProperties()->SetStringProperty(m_propertyHandle, vr::Prop_NamedIconPathDeviceStandby_String, "{kinectV2}/icons/base_status_standby.png"); 47 | 48 | vr::VRProperties()->SetBoolProperty(m_propertyHandle, vr::Prop_HasDisplayComponent_Bool, false); 49 | vr::VRProperties()->SetBoolProperty(m_propertyHandle, vr::Prop_HasCameraComponent_Bool, false); 50 | vr::VRProperties()->SetBoolProperty(m_propertyHandle, vr::Prop_HasDriverDirectModeComponent_Bool, false); 51 | vr::VRProperties()->SetBoolProperty(m_propertyHandle, vr::Prop_HasVirtualDisplayComponent_Bool, false); 52 | 53 | vr::VRProperties()->SetUint64Property(m_propertyHandle, vr::Prop_VendorSpecific_Reserved_Start, 0x4B696E6563745632); // "KinectV2" 54 | } 55 | 56 | void CKinectStation::DebugRequest(const char* pchRequest, char* pchResponseBuffer, uint32_t unResponseBufferSize) 57 | { 58 | m_serverDriver->ProcessExternalMessage(pchRequest); 59 | } 60 | -------------------------------------------------------------------------------- /driver_kinectV2/CKinectStation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CEmulatedDevice.h" 3 | 4 | class CServerDriver; 5 | 6 | class CKinectStation final : public CEmulatedDevice 7 | { 8 | CServerDriver *m_serverDriver; 9 | 10 | CKinectStation(const CKinectStation &that) = delete; 11 | CKinectStation& operator=(const CKinectStation &that) = delete; 12 | 13 | void SetupProperties() override; 14 | 15 | // vr::ITrackedDeviceServerDriver 16 | void DebugRequest(const char* pchRequest, char* pchResponseBuffer, uint32_t unResponseBufferSize) override; 17 | public: 18 | explicit CKinectStation(CServerDriver *p_server); 19 | ~CKinectStation(); 20 | }; 21 | -------------------------------------------------------------------------------- /driver_kinectV2/CServerDriver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CEmulatedDevice; 4 | class CKinectHandler; 5 | struct FrameData; 6 | 7 | class CServerDriver final : public vr::IServerTrackedDeviceProvider 8 | { 9 | static const char* const ms_interfaces[]; 10 | 11 | CKinectHandler *m_kinectHandler; 12 | std::thread *m_kinectThread; 13 | std::mutex m_kinectLock; 14 | std::atomic m_kinectActive; 15 | std::vector m_frameHistory; 16 | size_t m_frameHistoryCount; 17 | 18 | CEmulatedDevice *m_kinectStation; 19 | CEmulatedDevice *m_trackers[_JointType::JointType_Count]; 20 | 21 | glm::vec3 m_basePosition; 22 | glm::quat m_baseRotation; 23 | bool m_trackingState; 24 | unsigned char m_interpolation; 25 | 26 | ULONGLONG m_dashboardLaunchTick; 27 | bool m_dashboardLaunched; 28 | 29 | CServerDriver(const CServerDriver &that) = delete; 30 | CServerDriver& operator=(const CServerDriver &that) = delete; 31 | 32 | void KinectProcess(); 33 | 34 | // vr::IServerTrackedDeviceProvider 35 | vr::EVRInitError Init(vr::IVRDriverContext *pDriverContext); 36 | void Cleanup(); 37 | const char* const* GetInterfaceVersions(); 38 | void RunFrame(); 39 | bool ShouldBlockStandbyMode(); 40 | void EnterStandby(); 41 | void LeaveStandby(); 42 | public: 43 | CServerDriver(); 44 | ~CServerDriver(); 45 | 46 | void ProcessExternalMessage(const char *p_message); 47 | }; 48 | -------------------------------------------------------------------------------- /driver_kinectV2/CTrackerVive.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CEmulatedDevice.h" 4 | 5 | class CTrackerVive final : public CEmulatedDevice 6 | { 7 | size_t m_index; 8 | 9 | CTrackerVive(const CTrackerVive &that) = delete; 10 | CTrackerVive& operator=(const CTrackerVive &that) = delete; 11 | 12 | void SetupProperties() override; 13 | public: 14 | explicit CTrackerVive(size_t p_index); 15 | ~CTrackerVive(); 16 | }; 17 | -------------------------------------------------------------------------------- /driver_kinectV2/MathUtils.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "MathUtils.h" 4 | 5 | const float g_pi = glm::pi(); 6 | 7 | float QuadraticEaseInOut(float p_value) 8 | { 9 | float l_result = 0.f; 10 | if(p_value < 0.5f) l_result = 2.f*glm::pow(p_value, 2.f); 11 | else l_result = (-2.f * glm::pow(p_value, 2.f)) + (4.f * p_value) - 1.f; 12 | return l_result; 13 | } 14 | 15 | float CubicEaseInOut(float p_value) 16 | { 17 | float l_result = 0.f; 18 | if(p_value < 0.5f) l_result = 4.f * glm::pow(p_value, 3.f); 19 | else 20 | { 21 | float l_step = ((2.f * p_value) - 2.f); 22 | l_result = 0.5f * glm::pow(l_step, 3.f) + 1.f; 23 | } 24 | return l_result; 25 | } 26 | 27 | float QuarticEaseInOut(float p_value) 28 | { 29 | float l_result = 0.f; 30 | if(p_value < 0.5f) l_result = 8.f * glm::pow(p_value, 4.f); 31 | else 32 | { 33 | float l_step = p_value - 1.f; 34 | l_result = -8.f * glm::pow(l_step, 4.f) + 1.f; 35 | } 36 | return l_result; 37 | } 38 | 39 | float QuinticEaseInOut(float p_value) 40 | { 41 | float l_result = 0.f; 42 | 43 | if(p_value < 0.5f) l_result = 16 * glm::pow(p_value, 5.f); 44 | else 45 | { 46 | float l_step = ((2.f * p_value) - 2.f); 47 | l_result = 0.5f * glm::pow(l_step, 5.f) + 1.f; 48 | } 49 | return l_result; 50 | } 51 | 52 | float ExponentialEaseInOut(float p_value) 53 | { 54 | float l_result = p_value; 55 | if(p_value > 0.f && p_value < 1.f) 56 | { 57 | if(p_value < 0.5) l_result = 0.5f * glm::pow(2.f, (20.f * p_value) - 10.f); 58 | else l_result = -0.5f * glm::pow(2.f, (-20.f * p_value) + 10.f) + 1.f; 59 | } 60 | return l_result; 61 | } 62 | 63 | float SineEaseInOut(float p_value) 64 | { 65 | return -0.5f*(cos(g_pi*p_value) - 1.f); 66 | } 67 | 68 | float CircularEaseInOut(float p_value) 69 | { 70 | float l_result = 0.f; 71 | if(p_value < 0.5f) l_result = 0.5f * (1.f - glm::sqrt(1.f - 4.f * glm::pow(p_value, 2.f))); 72 | else l_result = 0.5f * (glm::sqrt(-((2.f * p_value) - 3.f) * ((2.f * p_value) - 1.f)) + 1.f); 73 | return l_result; 74 | } 75 | -------------------------------------------------------------------------------- /driver_kinectV2/MathUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | float QuadraticEaseInOut(float p_value); 4 | float CubicEaseInOut(float p_value); 5 | float QuarticEaseInOut(float p_value); 6 | float QuinticEaseInOut(float p_value); 7 | float ExponentialEaseInOut(float p_value); 8 | float SineEaseInOut(float p_value); 9 | float CircularEaseInOut(float p_value); 10 | -------------------------------------------------------------------------------- /driver_kinectV2/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "CServerDriver.h" 4 | 5 | char g_modulePath[2048U]; 6 | 7 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID /* lpReserved */) 8 | { 9 | switch(ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | GetModuleFileNameA(hModule, g_modulePath, 2048U); 13 | break; 14 | case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | CServerDriver g_serverDriver; 21 | 22 | extern "C" __declspec(dllexport) void* HmdDriverFactory(const char *pInterfaceName, int *pReturnCode) 23 | { 24 | void *l_result = nullptr; 25 | if(!strcmp(vr::IServerTrackedDeviceProvider_Version, pInterfaceName)) l_result = dynamic_cast(&g_serverDriver); 26 | else 27 | { 28 | if(pReturnCode) *pReturnCode = vr::VRInitError_Init_InterfaceNotFound; 29 | } 30 | return l_result; 31 | } 32 | -------------------------------------------------------------------------------- /driver_kinectV2/driver_kinectV2.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | vendor\pugixml 15 | 16 | 17 | shared 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | {9f86aeb1-fd8a-4bc6-aa1e-604a8a9386f4} 35 | 36 | 37 | {cb48c047-90c6-4920-a1a6-d02294301432} 38 | 39 | 40 | {d6a580c1-d7d7-4a4b-8855-2308f112421d} 41 | 42 | 43 | -------------------------------------------------------------------------------- /driver_kinectV2/driver_kinectV2.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | C:\Program Files %28x86%29\Steam\steamapps\common\SteamVR\bin\win64 5 | WindowsLocalDebugger 6 | C:\Program Files %28x86%29\Steam\steamapps\common\SteamVR\bin\win64\vrserver.exe 7 | true 8 | 9 | 10 | C:\Program Files %28x86%29\Steam\steamapps\common\SteamVR\bin\win64 11 | WindowsLocalDebugger 12 | C:\Program Files %28x86%29\Steam\steamapps\common\SteamVR\bin\win64\vrserver.exe 13 | true 14 | 15 | 16 | $(SolutionDir)\bin\win32 17 | WindowsLocalDebugger 18 | 19 | 20 | 21 | $(SolutionDir)\bin\win32 22 | WindowsLocalDebugger 23 | 24 | 25 | -------------------------------------------------------------------------------- /driver_kinectV2/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /driver_kinectV2/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include "openvr_driver.h" 19 | 20 | #include "glm/glm.hpp" 21 | #include "glm/gtc/quaternion.hpp" 22 | 23 | #include "pugixml.hpp" 24 | -------------------------------------------------------------------------------- /kinect_dash/Core/Core.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Core/Core.h" 4 | #include "Managers/ConfigManager.h" 5 | #include "Managers/SfmlManager.h" 6 | #include "Managers/GuiManager.h" 7 | #include "Managers/VRManager.h" 8 | 9 | const std::chrono::milliseconds g_threadSleep(33U); // ~30 fps lock 10 | 11 | Core::Core() 12 | { 13 | m_valid = false; 14 | m_active = false; 15 | 16 | m_configManager = nullptr; 17 | m_vrManager = nullptr; 18 | m_sfmlManager = nullptr; 19 | m_guiManager = nullptr; 20 | } 21 | Core::~Core() 22 | { 23 | } 24 | 25 | bool Core::Intitialize() 26 | { 27 | if(!m_valid) 28 | { 29 | m_configManager = new ConfigManager(); 30 | m_configManager->Load(); 31 | 32 | try 33 | { 34 | m_vrManager = new VRManager(this); 35 | m_sfmlManager = new SfmlManager(this); 36 | m_guiManager = new GuiManager(this); 37 | 38 | m_vrManager->SetOverlayTexture(m_guiManager->GetRenderTargetTextureName()); 39 | 40 | m_valid = true; 41 | m_active = true; 42 | } 43 | catch(std::exception &l_exception) 44 | { 45 | MessageBoxA(NULL, l_exception.what(), "KinectV2 Dashboard", MB_OK | MB_ICONEXCLAMATION); 46 | } 47 | } 48 | return m_valid; 49 | } 50 | void Core::Terminate() 51 | { 52 | if(m_valid) 53 | { 54 | delete m_guiManager; 55 | m_guiManager = nullptr; 56 | 57 | delete m_sfmlManager; 58 | m_sfmlManager = nullptr; 59 | 60 | delete m_vrManager; 61 | m_vrManager = nullptr; 62 | 63 | m_configManager->Save(); 64 | delete m_configManager; 65 | m_configManager = nullptr; 66 | 67 | m_valid = false; 68 | } 69 | } 70 | 71 | bool Core::DoPulse() 72 | { 73 | if(m_active) 74 | { 75 | m_active = (m_active && m_vrManager->DoPulse()); 76 | m_active = (m_active && m_sfmlManager->DoPulse()); 77 | 78 | std::this_thread::sleep_for(g_threadSleep); 79 | } 80 | return m_active; 81 | } 82 | 83 | ConfigManager* Core::GetConfigManager() const 84 | { 85 | return m_configManager; 86 | } 87 | VRManager* Core::GetVRManager() const 88 | { 89 | return m_vrManager; 90 | } 91 | SfmlManager* Core::GetSfmlManager() const 92 | { 93 | return m_sfmlManager; 94 | } 95 | GuiManager* Core::GetGuiManager() const 96 | { 97 | return m_guiManager; 98 | } 99 | -------------------------------------------------------------------------------- /kinect_dash/Core/Core.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class SfmlManager; 4 | class VRManager; 5 | class ConfigManager; 6 | class GuiManager; 7 | 8 | class Core final 9 | { 10 | bool m_valid; 11 | bool m_active; 12 | 13 | ConfigManager *m_configManager; 14 | VRManager *m_vrManager; 15 | SfmlManager *m_sfmlManager; 16 | GuiManager *m_guiManager; 17 | 18 | Core(const Core &that) = delete; 19 | Core& operator=(const Core &that) = delete; 20 | public: 21 | Core(); 22 | ~Core(); 23 | 24 | bool Intitialize(); 25 | void Terminate(); 26 | 27 | ConfigManager* GetConfigManager() const; 28 | VRManager* GetVRManager() const; 29 | SfmlManager* GetSfmlManager() const; 30 | GuiManager* GetGuiManager() const; 31 | 32 | bool DoPulse(); 33 | }; 34 | 35 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiButton.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Gui/GuiButton.h" 4 | 5 | GuiButton::GuiButton(const std::string& p_name) : GuiElement(p_name) 6 | { 7 | m_clickState = false; 8 | } 9 | GuiButton::~GuiButton() 10 | { 11 | } 12 | 13 | void GuiButton::SetClickCallback(const std::function &p_callback) 14 | { 15 | m_clickCallback = p_callback; 16 | } 17 | 18 | void GuiButton::Update() 19 | { 20 | GuiElement::Update(); 21 | 22 | ImGui::PushStyleColor(ImGuiCol_Button, m_imguiColor); 23 | bool l_state = ImGui::Button(m_name.c_str(), m_imguiSize); 24 | ImGui::PopStyleColor(1); 25 | if(m_clickState != l_state) 26 | { 27 | m_clickState = l_state; 28 | if(m_clickCallback) m_clickCallback(m_clickState); 29 | } 30 | 31 | GuiElement::UpdateChildren(); 32 | } 33 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiButton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Gui/GuiElement.h" 3 | 4 | class GuiButton final : public GuiElement 5 | { 6 | std::function m_clickCallback; 7 | bool m_clickState; 8 | 9 | GuiButton(const GuiButton &that) = delete; 10 | GuiButton& operator=(const GuiButton &that) = delete; 11 | 12 | // GuiElement 13 | void Update() override; 14 | public: 15 | explicit GuiButton(const std::string &p_name); 16 | ~GuiButton(); 17 | 18 | void SetClickCallback(const std::function &p_callback); 19 | }; 20 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiCheckbox.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Gui/GuiCheckbox.h" 3 | 4 | 5 | GuiCheckbox::GuiCheckbox(const std::string &p_name, bool p_state) : GuiElement(p_name) 6 | { 7 | m_lastState = p_state; 8 | m_currentState = p_state; 9 | } 10 | GuiCheckbox::~GuiCheckbox() 11 | { 12 | } 13 | 14 | void GuiCheckbox::SetCheckCallback(const std::function &p_callback) 15 | { 16 | m_checkCallback = p_callback; 17 | } 18 | 19 | void GuiCheckbox::Update() 20 | { 21 | GuiElement::Update(); 22 | 23 | ImGui::Checkbox(m_name.c_str(), &m_currentState); 24 | if(m_lastState != m_currentState) 25 | { 26 | m_lastState = m_currentState; 27 | if(m_checkCallback) m_checkCallback(m_lastState); 28 | } 29 | GuiElement::UpdateChildren(); 30 | } 31 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiCheckbox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Gui/GuiElement.h" 3 | 4 | class GuiCheckbox final : public GuiElement 5 | { 6 | bool m_lastState; 7 | bool m_currentState; 8 | std::function m_checkCallback; 9 | 10 | GuiCheckbox(const GuiCheckbox &that) = delete; 11 | GuiCheckbox& operator=(const GuiCheckbox &that) = delete; 12 | 13 | // GuiElement 14 | void Update() override; 15 | public: 16 | explicit GuiCheckbox(const std::string &p_name, bool p_state = false); 17 | ~GuiCheckbox(); 18 | 19 | void SetCheckCallback(const std::function &p_callback); 20 | }; 21 | 22 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiElement.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Gui/GuiElement.h" 4 | 5 | 6 | GuiElement::GuiElement(const std::string &p_name) 7 | { 8 | m_name.assign(p_name); 9 | m_position = sf::Vector2f(0.f,0.f); 10 | m_imguiPosition = ImVec2(0.f, 0.f); 11 | m_size = sf::Vector2f(0.f,0.f); 12 | m_imguiSize = ImVec2(0.f, 0.f); 13 | m_color = sf::Color(0, 0, 0, 255); 14 | m_imguiColor = ImVec4(0, 0, 0, 255); 15 | 16 | m_sameLine = false; 17 | 18 | m_parent = nullptr; 19 | } 20 | GuiElement::~GuiElement() 21 | { 22 | } 23 | 24 | bool GuiElement::Add(GuiElement *p_child) 25 | { 26 | if(p_child->m_parent == nullptr) 27 | { 28 | m_children.push_back(p_child); 29 | p_child->m_parent = this; 30 | } 31 | 32 | return (p_child->m_parent == this); 33 | } 34 | 35 | void GuiElement::Remove(GuiElement *p_child) 36 | { 37 | if(p_child->m_parent == this) 38 | { 39 | p_child->m_parent = nullptr; 40 | m_children.erase(std::remove(m_children.begin(), m_children.end(), p_child), m_children.end()); 41 | } 42 | } 43 | 44 | bool GuiElement::HasChild(const GuiElement *p_child) 45 | { 46 | return (std::find(m_children.begin(), m_children.end(), p_child) != m_children.end()); 47 | } 48 | 49 | void GuiElement::SetPosition(const sf::Vector2f &p_pos) 50 | { 51 | m_position = p_pos; 52 | m_imguiPosition.x = m_position.x; 53 | m_imguiPosition.y = m_position.y; 54 | } 55 | const sf::Vector2f& GuiElement::GetPosition() const 56 | { 57 | return m_position; 58 | } 59 | 60 | void GuiElement::SetSize(const sf::Vector2f &p_size) 61 | { 62 | m_size = p_size; 63 | m_imguiSize.x = m_size.x; 64 | m_imguiSize.y = m_size.y; 65 | } 66 | const sf::Vector2f& GuiElement::GetSize() const 67 | { 68 | return m_size; 69 | } 70 | 71 | void GuiElement::SetColor(const sf::Color &p_col) 72 | { 73 | m_color = p_col; 74 | m_imguiColor.x = static_cast(m_color.r) / 255.f; 75 | m_imguiColor.y = static_cast(m_color.g) / 255.f; 76 | m_imguiColor.z = static_cast(m_color.b) / 255.f; 77 | m_imguiColor.w = static_cast(m_color.a) / 255.f; 78 | } 79 | const sf::Color& GuiElement::GetColor() const 80 | { 81 | return m_color; 82 | } 83 | 84 | void GuiElement::SetOnSameLine(bool p_state) 85 | { 86 | m_sameLine = p_state; 87 | } 88 | bool GuiElement::GetOnSameLine() const 89 | { 90 | return m_sameLine; 91 | } 92 | 93 | void GuiElement::Update() 94 | { 95 | if(m_sameLine) ImGui::SameLine(); 96 | } 97 | 98 | void GuiElement::UpdateChildren() 99 | { 100 | for(auto l_child : m_children) l_child->Update(); 101 | } 102 | 103 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiElement.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class GuiElement 4 | { 5 | GuiElement(const GuiElement &that) = delete; 6 | GuiElement& operator=(const GuiElement &that) = delete; 7 | 8 | bool m_sameLine; 9 | public: 10 | bool Add(GuiElement *p_child); 11 | void Remove(GuiElement *p_child); 12 | bool HasChild(const GuiElement *p_child); 13 | 14 | void SetPosition(const sf::Vector2f &p_pos); 15 | const sf::Vector2f& GetPosition() const; 16 | 17 | void SetSize(const sf::Vector2f &p_size); 18 | const sf::Vector2f& GetSize() const; 19 | 20 | // Not all elements are affected by color 21 | void SetColor(const sf::Color &p_col); 22 | const sf::Color& GetColor() const; 23 | 24 | void SetOnSameLine(bool p_state); 25 | bool GetOnSameLine() const; 26 | protected: 27 | std::string m_name; 28 | sf::Vector2f m_position; 29 | ImVec2 m_imguiPosition; 30 | sf::Vector2f m_size; 31 | ImVec2 m_imguiSize; 32 | sf::Color m_color; 33 | ImVec4 m_imguiColor; 34 | 35 | std::vector m_children; 36 | GuiElement *m_parent; 37 | 38 | explicit GuiElement(const std::string &p_name); 39 | ~GuiElement(); 40 | 41 | virtual void Update(); 42 | void UpdateChildren(); 43 | }; 44 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiInputText.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Gui/GuiInputText.h" 4 | 5 | GuiInputText::GuiInputText(const std::string &p_name) : GuiElement(p_name) 6 | { 7 | m_sidesSwitched = false; 8 | } 9 | GuiInputText::~GuiInputText() 10 | { 11 | } 12 | 13 | void GuiInputText::SetText(const std::string &p_text) 14 | { 15 | m_text.assign(p_text); 16 | } 17 | const std::string& GuiInputText::GetText() const 18 | { 19 | return m_text; 20 | } 21 | 22 | void GuiInputText::SetSidesSwitched(bool p_state) 23 | { 24 | m_sidesSwitched = p_state; 25 | } 26 | bool GuiInputText::GetSidesSwitched() const 27 | { 28 | return m_sidesSwitched; 29 | } 30 | 31 | void GuiInputText::Update() 32 | { 33 | GuiElement::Update(); 34 | 35 | if(m_sidesSwitched) 36 | { 37 | ImGui::Text(m_name.c_str()); 38 | ImGui::SameLine(); 39 | } 40 | 41 | ImGui::PushItemWidth(m_size.x); 42 | ImGui::InputText(m_sidesSwitched ? "" : m_name.c_str(), &m_text[0U], m_text.size(), ImGuiInputTextFlags_::ImGuiInputTextFlags_ReadOnly); 43 | ImGui::PopItemWidth(); 44 | 45 | GuiElement::UpdateChildren(); 46 | } 47 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiInputText.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Gui/GuiElement.h" 3 | 4 | class GuiInputText final : public GuiElement 5 | { 6 | std::string m_text; 7 | bool m_sidesSwitched; 8 | 9 | GuiInputText(const GuiInputText &that) = delete; 10 | GuiInputText& operator=(const GuiInputText &that) = delete; 11 | 12 | // GuiElement 13 | void Update() override; 14 | public: 15 | explicit GuiInputText(const std::string &p_name); 16 | ~GuiInputText(); 17 | 18 | void SetText(const std::string &p_text); 19 | const std::string& GetText() const; 20 | 21 | void SetSidesSwitched(bool p_state); 22 | bool GetSidesSwitched() const; 23 | }; 24 | 25 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiLabel.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Gui/GuiLabel.h" 4 | 5 | GuiLabel::GuiLabel(const std::string &p_caption) : GuiElement(p_caption) 6 | { 7 | } 8 | GuiLabel::~GuiLabel() 9 | { 10 | } 11 | 12 | void GuiLabel::SetText(const std::string &p_text) 13 | { 14 | m_text.assign(p_text); 15 | } 16 | const std::string& GuiLabel::GetText() const 17 | { 18 | return m_text; 19 | } 20 | 21 | void GuiLabel::Update() 22 | { 23 | GuiElement::Update(); 24 | 25 | ImGui::LabelText(m_name.c_str(), m_text.c_str()); 26 | 27 | GuiElement::UpdateChildren(); 28 | } 29 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiLabel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Gui/GuiElement.h" 3 | 4 | class GuiLabel final : public GuiElement 5 | { 6 | std::string m_text; 7 | 8 | GuiLabel(const GuiLabel &that) = delete; 9 | GuiLabel& operator=(const GuiLabel &that) = delete; 10 | 11 | // GuiElement 12 | void Update() override; 13 | public: 14 | explicit GuiLabel(const std::string &p_caption); 15 | ~GuiLabel(); 16 | 17 | void SetText(const std::string &p_text); 18 | const std::string& GetText() const; 19 | }; 20 | 21 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiRadioButton.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Gui/GuiRadioButton.h" 4 | 5 | 6 | GuiRadioButton::GuiRadioButton(const std::string& p_name) : GuiElement(p_name) 7 | { 8 | m_active = false; 9 | } 10 | GuiRadioButton::~GuiRadioButton() 11 | { 12 | } 13 | 14 | void GuiRadioButton::SetActive(bool p_state) 15 | { 16 | m_active = p_state; 17 | } 18 | bool GuiRadioButton::GetActive() const 19 | { 20 | return m_active; 21 | } 22 | 23 | void GuiRadioButton::SetClickCallback(const std::function &p_callback) 24 | { 25 | m_clickCallback = p_callback; 26 | } 27 | 28 | void GuiRadioButton::Update() 29 | { 30 | GuiElement::Update(); 31 | 32 | if(ImGui::RadioButton(m_name.c_str(), m_active)) 33 | { 34 | m_active = true; 35 | if(m_clickCallback) m_clickCallback(); 36 | } 37 | 38 | GuiElement::UpdateChildren(); 39 | } -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiRadioButton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Gui/GuiElement.h" 3 | 4 | class GuiRadioButton final : public GuiElement 5 | { 6 | bool m_active; 7 | std::function m_clickCallback; 8 | 9 | GuiRadioButton(const GuiRadioButton &that) = delete; 10 | GuiRadioButton& operator=(const GuiRadioButton &that) = delete; 11 | 12 | // GuiElement 13 | void Update() override; 14 | public: 15 | explicit GuiRadioButton(const std::string& p_name); 16 | ~GuiRadioButton(); 17 | 18 | void SetActive(bool p_state); 19 | bool GetActive() const; 20 | 21 | void SetClickCallback(const std::function &p_callback); 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiScreen.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Gui/GuiScreen.h" 4 | 5 | GuiScreen::GuiScreen(const std::string &p_name, const sf::Vector2i &p_size) : GuiElement(p_name) 6 | { 7 | m_size.x = static_cast(p_size.x); 8 | m_size.y = static_cast(p_size.y); 9 | } 10 | 11 | GuiScreen::~GuiScreen() 12 | { 13 | } 14 | 15 | void GuiScreen::InjectMouseMove(const sf::Vector2f &p_pos) 16 | { 17 | m_mousePosition.x = static_cast(p_pos.x); 18 | m_mousePosition.y = static_cast(p_pos.y); 19 | 20 | sf::Event l_event; 21 | l_event.type = sf::Event::EventType::MouseMoved; 22 | l_event.mouseMove.x = m_mousePosition.x; 23 | l_event.mouseMove.y = m_mousePosition.y; 24 | ImGui::SFML::ProcessEvent(l_event); 25 | } 26 | 27 | void GuiScreen::InjectMouseClick(sf::Mouse::Button p_button, bool p_press) 28 | { 29 | sf::Event l_event; 30 | l_event.type = (p_press ? sf::Event::EventType::MouseButtonPressed : sf::Event::EventType::MouseButtonReleased); 31 | l_event.mouseButton.button = p_button; 32 | l_event.mouseButton.x = m_mousePosition.x; 33 | l_event.mouseButton.y = m_mousePosition.y; 34 | ImGui::SFML::ProcessEvent(l_event); 35 | } 36 | 37 | void GuiScreen::Update() 38 | { 39 | ImGui::SFML::Update(m_mousePosition, m_size, m_deltaClock.restart()); 40 | 41 | GuiElement::UpdateChildren(); 42 | } 43 | 44 | void GuiScreen::Render() 45 | { 46 | ImGui::SFML::Render(); 47 | } 48 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiScreen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Gui/GuiElement.h" 3 | 4 | class GuiScreen final : public GuiElement 5 | { 6 | sf::Clock m_deltaClock; 7 | sf::Vector2i m_mousePosition; 8 | 9 | GuiScreen(const GuiScreen &that) = delete; 10 | GuiScreen& operator=(const GuiScreen &that) = delete; 11 | public: 12 | explicit GuiScreen(const std::string &p_name, const sf::Vector2i &p_size); 13 | ~GuiScreen(); 14 | 15 | void InjectMouseMove(const sf::Vector2f &p_pos); 16 | void InjectMouseClick(sf::Mouse::Button p_button, bool p_press); 17 | 18 | void Update() override; 19 | void Render(); 20 | }; 21 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiSeparator.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "GuiSeparator.h" 4 | 5 | GuiSeparator::GuiSeparator() : GuiElement("") 6 | { 7 | } 8 | GuiSeparator::~GuiSeparator() 9 | { 10 | } 11 | 12 | void GuiSeparator::Update() 13 | { 14 | GuiElement::Update(); 15 | ImGui::Separator(); 16 | GuiElement::UpdateChildren(); 17 | } 18 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiSeparator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Gui/GuiElement.h" 3 | 4 | class GuiSeparator final : public GuiElement 5 | { 6 | GuiSeparator(const GuiSeparator &that) = delete; 7 | GuiSeparator& operator=(const GuiSeparator &that) = delete; 8 | 9 | // GuiElement 10 | void Update() override; 11 | public: 12 | GuiSeparator(); 13 | ~GuiSeparator(); 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiText.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Gui/GuiText.h" 3 | 4 | 5 | GuiText::GuiText(const std::string &p_name) : GuiElement(p_name) 6 | { 7 | } 8 | GuiText::~GuiText() 9 | { 10 | } 11 | 12 | void GuiText::Update() 13 | { 14 | GuiElement::Update(); 15 | 16 | ImGui::Text(m_name.c_str()); 17 | 18 | GuiElement::UpdateChildren(); 19 | } 20 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiText.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Gui/GuiElement.h" 3 | 4 | class GuiText final : public GuiElement 5 | { 6 | GuiText(const GuiText &that) = delete; 7 | GuiText& operator=(const GuiText &that) = delete; 8 | 9 | // GuiElement 10 | void Update() override; 11 | public: 12 | explicit GuiText(const std::string &p_name); 13 | ~GuiText(); 14 | }; 15 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Gui/GuiWindow.h" 4 | 5 | GuiWindow::GuiWindow(const std::string &p_title) : GuiElement(p_title) 6 | { 7 | } 8 | GuiWindow::~GuiWindow() 9 | { 10 | } 11 | 12 | void GuiWindow::Update() 13 | { 14 | GuiElement::Update(); 15 | 16 | ImGui::Begin(m_name.c_str(), nullptr, ImGuiWindowFlags_::ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_::ImGuiWindowFlags_NoMove | ImGuiWindowFlags_::ImGuiWindowFlags_NoResize | ImGuiWindowFlags_::ImGuiWindowFlags_NoScrollbar); 17 | ImGui::SetWindowPos(m_imguiPosition); 18 | ImGui::SetWindowSize(m_imguiSize); 19 | 20 | GuiElement::UpdateChildren(); 21 | ImGui::End(); 22 | } 23 | -------------------------------------------------------------------------------- /kinect_dash/Gui/GuiWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Gui/GuiElement.h" 3 | 4 | class GuiWindow final : public GuiElement 5 | { 6 | GuiWindow(const GuiWindow &that) = delete; 7 | GuiWindow& operator=(const GuiWindow &that) = delete; 8 | 9 | // GuiElement 10 | void Update() override; 11 | public: 12 | explicit GuiWindow(const std::string &p_title); 13 | ~GuiWindow(); 14 | }; 15 | -------------------------------------------------------------------------------- /kinect_dash/Managers/CalibrationHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class VRManager; 3 | 4 | class CalibrationHelper final 5 | { 6 | friend VRManager; 7 | VRManager *m_vrManager; 8 | 9 | enum CircleQuadrant : unsigned char 10 | { 11 | CQ_Right = 0U, 12 | CQ_Up, 13 | CQ_Left, 14 | CQ_Down, 15 | 16 | CQ_None = 255U 17 | }; 18 | struct InputInfo 19 | { 20 | unsigned char m_quadrant; 21 | bool m_trigger; 22 | }; 23 | 24 | InputInfo m_inputInfoLeft; 25 | InputInfo m_inputInfoRight; 26 | 27 | glm::vec3 m_basePosition; 28 | glm::quat m_baseRotation; 29 | 30 | bool m_active; 31 | 32 | CalibrationHelper(const CalibrationHelper &that) = delete; 33 | CalibrationHelper& operator=(const CalibrationHelper &that) = delete; 34 | protected: 35 | explicit CalibrationHelper(VRManager *p_vrManager); 36 | ~CalibrationHelper(); 37 | 38 | void StartCalibration(); 39 | void StopCalibration(); 40 | bool IsCalibrationActive() const; 41 | 42 | void RecieveControllerAxis(bool p_left, const glm::vec2 &p_axis); 43 | void RecieveControllerTrigger(bool p_left, bool p_state); 44 | void ReciveControllerGrip(bool p_left, bool p_state); 45 | void RecieveControllerDisconnect(bool p_left); 46 | 47 | void DoPulse(); 48 | }; 49 | 50 | -------------------------------------------------------------------------------- /kinect_dash/Managers/ConfigManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class ConfigManager final 4 | { 5 | friend class Core; 6 | 7 | glm::vec3 m_basePosition; 8 | glm::quat m_baseRotation; 9 | size_t m_interpolationType; 10 | bool m_trackingState; 11 | std::vector m_trackersStates; 12 | 13 | ConfigManager(const ConfigManager &that) = delete; 14 | ConfigManager& operator=(const ConfigManager &that) = delete; 15 | public: 16 | enum FrameInterpolation : size_t 17 | { 18 | FI_Linear = 0U, 19 | FI_Quadratic, 20 | FI_Cubic, 21 | FI_Quartic, 22 | FI_Quintic, 23 | FI_Exponential, 24 | FI_Sine, 25 | FI_Circular 26 | }; 27 | 28 | void ChangeTrackerState(size_t p_index); 29 | bool GetTrackerState(size_t p_index) const; 30 | 31 | void ChangeTrackingState(); 32 | bool GetTrackingState() const; 33 | 34 | void SetInterpolationType(size_t p_type); 35 | size_t GetInterpolationType() const; 36 | 37 | void SetBasePosition(const glm::vec3 &p_pos); 38 | const glm::vec3& GetBasePosition() const; 39 | 40 | void SetBaseRotation(const glm::quat &p_rot); 41 | const glm::quat& GetBaseRotation() const; 42 | protected: 43 | ConfigManager(); 44 | ~ConfigManager(); 45 | 46 | void Load(); 47 | void Save(); 48 | }; 49 | 50 | -------------------------------------------------------------------------------- /kinect_dash/Managers/GuiManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Core; 4 | class GuiScreen; 5 | class GuiWindow; 6 | class GuiButton; 7 | class GuiText; 8 | class GuiInputText; 9 | class GuiSeparator; 10 | class GuiRadioButton; 11 | 12 | class GuiManager final 13 | { 14 | friend Core; 15 | friend class SfmlManager; 16 | friend class VRManager; 17 | Core *m_core; 18 | 19 | sf::RenderTexture *m_renderTexture; 20 | 21 | // Render target is needed 22 | GuiScreen *m_screen; 23 | 24 | // Trackers toggle 25 | GuiWindow *m_trackersWindow; 26 | std::vector m_trackersButtons; 27 | 28 | // Calibration info 29 | GuiWindow *m_calibrationWindow; 30 | std::vector m_calibrationFields; 31 | 32 | // Settings 33 | GuiWindow *m_settingsWindow; 34 | std::vector m_settingsButtons; 35 | GuiSeparator *m_settingsSeparator; 36 | GuiText *m_interpolationText; 37 | std::vector m_interpolationButtons; 38 | GuiSeparator *m_deviceSeparator; 39 | GuiButton *m_deviceStateButton; 40 | 41 | GuiManager(const GuiManager &that) = delete; 42 | GuiManager& operator=(const GuiManager &that) = delete; 43 | 44 | void OnTrackerToggle(bool p_state, size_t p_index); 45 | void OnTrackingToggle(bool p_state); 46 | void OnInterpolationChange(size_t p_type); 47 | void OnCalibrationStart(bool p_state); 48 | protected: 49 | explicit GuiManager(Core *p_core); 50 | ~GuiManager(); 51 | 52 | unsigned int GetRenderTargetTextureName() const; 53 | 54 | void Render(); // SfmlManager call only 55 | 56 | // VRManager/SfmlManager only 57 | void ReceiveMouseMove(float p_x, float p_y); 58 | void ReceiveMouseClick(bool p_left, bool p_press); 59 | }; 60 | -------------------------------------------------------------------------------- /kinect_dash/Managers/SfmlManager.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Core/Core.h" 4 | #include "Managers/SfmlManager.h" 5 | #include "Managers/GuiManager.h" 6 | 7 | SFML_DEFINE_DISCRETE_GPU_PREFERENCE; 8 | 9 | SfmlManager::SfmlManager(Core *p_core) 10 | { 11 | m_core = p_core; 12 | 13 | const sf::ContextSettings l_contextSettings(16U, 8U, 0U, 2U, 1U, sf::ContextSettings::Default, false); 14 | m_context = new sf::Context(l_contextSettings, 1024U, 512U); 15 | if(!m_context->setActive(true)) throw std::runtime_error("Unable to create SFML context"); 16 | 17 | m_active = true; 18 | } 19 | 20 | SfmlManager::~SfmlManager() 21 | { 22 | delete m_context; 23 | } 24 | 25 | bool SfmlManager::DoPulse() 26 | { 27 | if(m_active) 28 | { 29 | // Frame pass 30 | m_core->GetGuiManager()->Render(); 31 | } 32 | return m_active; 33 | } 34 | -------------------------------------------------------------------------------- /kinect_dash/Managers/SfmlManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Core; 4 | 5 | class SfmlManager final 6 | { 7 | friend Core; 8 | Core *m_core; 9 | 10 | sf::Context *m_context; 11 | bool m_active; 12 | 13 | SfmlManager(const SfmlManager &that) = delete; 14 | SfmlManager& operator=(const SfmlManager &that) = delete; 15 | protected: 16 | explicit SfmlManager(Core *p_core); 17 | ~SfmlManager(); 18 | 19 | bool DoPulse(); 20 | }; 21 | -------------------------------------------------------------------------------- /kinect_dash/Managers/VRManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Core; 4 | class CalibrationHelper; 5 | 6 | class VRManager final 7 | { 8 | friend Core; 9 | Core *m_core; 10 | 11 | bool m_active; 12 | vr::IVRSystem *m_vrSystem; 13 | 14 | vr::VROverlayHandle_t m_notificationOverlay; 15 | vr::VRNotificationId m_notification; 16 | 17 | vr::VROverlayHandle_t m_dashboardOverlay; 18 | vr::VROverlayHandle_t m_dashboardOverlayThumbnail; 19 | vr::Texture_t m_dashboardTexture; 20 | 21 | vr::TrackedDeviceIndex_t m_kinectDevice; 22 | vr::TrackedDeviceIndex_t m_leftHand; 23 | vr::TrackedDeviceIndex_t m_rightHand; 24 | 25 | vr::VREvent_t m_event; 26 | 27 | CalibrationHelper *m_calibrationHelper; 28 | 29 | VRManager(const VRManager &that) = delete; 30 | VRManager& operator=(const VRManager &that) = delete; 31 | public: 32 | Core* GetCore() const; 33 | 34 | bool IsKinectDevicePresent() const; 35 | bool IsOverlayVisible() const; 36 | 37 | void SendTrackerToggle(size_t p_index); 38 | void SendTrackingToggle(); 39 | void SendInterpolationChange(size_t p_type); 40 | void SendCalibration(const glm::vec3 &p_pos, const glm::quat &p_rot); 41 | 42 | void LaunchCalibration(); 43 | protected: 44 | explicit VRManager(Core *p_core); 45 | ~VRManager(); 46 | 47 | void SetOverlayTexture(unsigned int p_name); 48 | 49 | bool DoPulse(); 50 | }; 51 | 52 | -------------------------------------------------------------------------------- /kinect_dash/base.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/kinect_dash/base.ico -------------------------------------------------------------------------------- /kinect_dash/kinect_dash.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/kinect_dash/kinect_dash.rc -------------------------------------------------------------------------------- /kinect_dash/kinect_dash.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(SolutionDir)\bin\win64 5 | WindowsLocalDebugger 6 | 7 | 8 | $(SolutionDir)\bin\win64 9 | WindowsLocalDebugger 10 | 11 | 12 | $(SolutionDir)\bin\win32 13 | WindowsLocalDebugger 14 | 15 | 16 | $(SolutionDir)\bin\win32 17 | WindowsLocalDebugger 18 | 19 | -------------------------------------------------------------------------------- /kinect_dash/main.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | #include "Core/Core.h" 4 | 5 | #ifdef _DEBUG 6 | int main(void) 7 | { 8 | #else 9 | int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow) 10 | { 11 | UNREFERENCED_PARAMETER(hInstance); 12 | UNREFERENCED_PARAMETER(hPrevInstance); 13 | UNREFERENCED_PARAMETER(lpCmdLine); 14 | UNREFERENCED_PARAMETER(nCmdShow); 15 | #endif 16 | Core *l_core = new Core(); 17 | if(l_core->Intitialize()) 18 | { 19 | while(l_core->DoPulse()); 20 | l_core->Terminate(); 21 | } 22 | delete l_core; 23 | 24 | return EXIT_SUCCESS; 25 | } -------------------------------------------------------------------------------- /kinect_dash/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/kinect_dash/resource.h -------------------------------------------------------------------------------- /kinect_dash/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /kinect_dash/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN 4 | #define NOMINMAX 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include "openvr.h" 12 | 13 | #include "SFML/Main.hpp" 14 | #include "SFML/System.hpp" 15 | #include "SFML/Window.hpp" 16 | #include "SFML/Graphics.hpp" 17 | #include "SFML/GpuPreference.hpp" 18 | 19 | #include "imgui.h" 20 | #include "imgui-SFML.h" 21 | 22 | #include "glm/glm.hpp" 23 | #include "glm/gtc/quaternion.hpp" 24 | 25 | #include "pugixml.hpp" 26 | -------------------------------------------------------------------------------- /resources/fonts/Hack-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/fonts/Hack-Regular.ttf -------------------------------------------------------------------------------- /resources/fonts/LICENSE.md: -------------------------------------------------------------------------------- 1 | The work in the Hack project is Copyright 2018 Source Foundry Authors and licensed under the MIT License 2 | 3 | The work in the DejaVu project was committed to the public domain. 4 | 5 | Bitstream Vera Sans Mono Copyright 2003 Bitstream Inc. and licensed under the Bitstream Vera License with Reserved Font Names "Bitstream" and "Vera" 6 | 7 | ### MIT License 8 | 9 | Copyright (c) 2018 Source Foundry Authors 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy 12 | of this software and associated documentation files (the "Software"), to deal 13 | in the Software without restriction, including without limitation the rights 14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in all 19 | copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 27 | SOFTWARE. 28 | 29 | ### BITSTREAM VERA LICENSE 30 | 31 | Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: 34 | 35 | The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. 36 | 37 | The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". 38 | 39 | This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. 40 | 41 | The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. 42 | 43 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. 44 | 45 | Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. 46 | -------------------------------------------------------------------------------- /resources/icons/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base.png -------------------------------------------------------------------------------- /resources/icons/base_status_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_error.png -------------------------------------------------------------------------------- /resources/icons/base_status_error@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_error@2x.png -------------------------------------------------------------------------------- /resources/icons/base_status_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_off.png -------------------------------------------------------------------------------- /resources/icons/base_status_off@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_off@2x.png -------------------------------------------------------------------------------- /resources/icons/base_status_ready.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_ready.png -------------------------------------------------------------------------------- /resources/icons/base_status_ready@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_ready@2x.png -------------------------------------------------------------------------------- /resources/icons/base_status_ready_alert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_ready_alert.png -------------------------------------------------------------------------------- /resources/icons/base_status_ready_alert@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_ready_alert@2x.png -------------------------------------------------------------------------------- /resources/icons/base_status_searching.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_searching.png -------------------------------------------------------------------------------- /resources/icons/base_status_searching@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_searching@2x.png -------------------------------------------------------------------------------- /resources/icons/base_status_searching_alert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_searching_alert.png -------------------------------------------------------------------------------- /resources/icons/base_status_searching_alert@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_searching_alert@2x.png -------------------------------------------------------------------------------- /resources/icons/base_status_standby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_standby.png -------------------------------------------------------------------------------- /resources/icons/base_status_standby@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/icons/base_status_standby@2x.png -------------------------------------------------------------------------------- /resources/rendermodels/kinect_sensor_2_0/bake_base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/rendermodels/kinect_sensor_2_0/bake_base.png -------------------------------------------------------------------------------- /resources/rendermodels/kinect_sensor_2_0/kinect_sensor_2_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "thumbnail" : "thumbnail_kinect.png", 3 | "components": { 4 | "body": { 5 | "filename": "kinect_sensor_2_0.obj", 6 | "component_local" : { 7 | "origin": [0.0, 0.0, 0.0], 8 | "rotate_xyz" : [0.0,0.0,0.0] 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /resources/rendermodels/kinect_sensor_2_0/kinect_sensor_2_0.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'kinect.blend' 2 | # Material Count: 1 3 | 4 | newmtl Base 5 | illum 4 6 | Kd 0.00 0.00 0.00 7 | Ka 0.00 0.00 0.00 8 | Tf 1.00 1.00 1.00 9 | Ni 1.00 10 | map_Kd bake_base.png 11 | -------------------------------------------------------------------------------- /resources/rendermodels/kinect_sensor_2_0/thumbnail_kinect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/resources/rendermodels/kinect_sensor_2_0/thumbnail_kinect.png -------------------------------------------------------------------------------- /resources/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /shared/Utils.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "Utils.h" 6 | 7 | size_t ReadEnumVector(const std::string &p_val, const std::vector &p_vec) 8 | { 9 | size_t l_result = std::numeric_limits::max(); 10 | for(auto iter = p_vec.begin(), iterEnd = p_vec.end(); iter != iterEnd; ++iter) 11 | { 12 | if(!iter->compare(p_val)) 13 | { 14 | l_result = std::distance(p_vec.begin(), iter); 15 | break; 16 | } 17 | } 18 | return l_result; 19 | } 20 | 21 | size_t ReadEnumVector(const char *p_val, const std::vector &p_vec) 22 | { 23 | size_t l_result = std::numeric_limits::max(); 24 | for(auto iter = p_vec.begin(), iterEnd = p_vec.end(); iter != iterEnd; ++iter) 25 | { 26 | if(!iter->compare(p_val)) 27 | { 28 | l_result = std::distance(p_vec.begin(), iter); 29 | break; 30 | } 31 | } 32 | return l_result; 33 | } 34 | -------------------------------------------------------------------------------- /shared/Utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | size_t ReadEnumVector(const std::string &p_val, const std::vector &p_vec); 4 | size_t ReadEnumVector(const char *p_val, const std::vector &p_vec); 5 | -------------------------------------------------------------------------------- /vendor/SFML/bin/win32/sfml-graphics-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/bin/win32/sfml-graphics-2.dll -------------------------------------------------------------------------------- /vendor/SFML/bin/win32/sfml-graphics-d-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/bin/win32/sfml-graphics-d-2.dll -------------------------------------------------------------------------------- /vendor/SFML/bin/win32/sfml-system-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/bin/win32/sfml-system-2.dll -------------------------------------------------------------------------------- /vendor/SFML/bin/win32/sfml-system-d-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/bin/win32/sfml-system-d-2.dll -------------------------------------------------------------------------------- /vendor/SFML/bin/win32/sfml-window-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/bin/win32/sfml-window-2.dll -------------------------------------------------------------------------------- /vendor/SFML/bin/win32/sfml-window-d-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/bin/win32/sfml-window-d-2.dll -------------------------------------------------------------------------------- /vendor/SFML/bin/win64/sfml-graphics-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/bin/win64/sfml-graphics-2.dll -------------------------------------------------------------------------------- /vendor/SFML/bin/win64/sfml-graphics-d-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/bin/win64/sfml-graphics-d-2.dll -------------------------------------------------------------------------------- /vendor/SFML/bin/win64/sfml-system-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/bin/win64/sfml-system-2.dll -------------------------------------------------------------------------------- /vendor/SFML/bin/win64/sfml-system-d-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/bin/win64/sfml-system-d-2.dll -------------------------------------------------------------------------------- /vendor/SFML/bin/win64/sfml-window-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/bin/win64/sfml-window-2.dll -------------------------------------------------------------------------------- /vendor/SFML/bin/win64/sfml-window-d-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/bin/win64/sfml-window-d-2.dll -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Audio.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_AUDIO_HPP 26 | #define SFML_AUDIO_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | 48 | #endif // SFML_AUDIO_HPP 49 | 50 | //////////////////////////////////////////////////////////// 51 | /// \defgroup audio Audio module 52 | /// 53 | /// Sounds, streaming (musics or custom sources), recording, 54 | /// spatialization. 55 | /// 56 | //////////////////////////////////////////////////////////// 57 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Audio/AlResource.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_ALRESOURCE_HPP 26 | #define SFML_ALRESOURCE_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | namespace sf 35 | { 36 | //////////////////////////////////////////////////////////// 37 | /// \brief Base class for classes that require an OpenAL context 38 | /// 39 | //////////////////////////////////////////////////////////// 40 | class SFML_AUDIO_API AlResource 41 | { 42 | protected: 43 | 44 | //////////////////////////////////////////////////////////// 45 | /// \brief Default constructor 46 | /// 47 | //////////////////////////////////////////////////////////// 48 | AlResource(); 49 | 50 | //////////////////////////////////////////////////////////// 51 | /// \brief Destructor 52 | /// 53 | //////////////////////////////////////////////////////////// 54 | ~AlResource(); 55 | }; 56 | 57 | } // namespace sf 58 | 59 | 60 | #endif // SFML_ALRESOURCE_HPP 61 | 62 | //////////////////////////////////////////////////////////// 63 | /// \class sf::AlResource 64 | /// \ingroup audio 65 | /// 66 | /// This class is for internal use only, it must be the base 67 | /// of every class that requires a valid OpenAL context in 68 | /// order to work. 69 | /// 70 | //////////////////////////////////////////////////////////// 71 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Audio/Export.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_AUDIO_EXPORT_HPP 26 | #define SFML_AUDIO_EXPORT_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | //////////////////////////////////////////////////////////// 35 | // Define portable import / export macros 36 | //////////////////////////////////////////////////////////// 37 | #if defined(SFML_AUDIO_EXPORTS) 38 | 39 | #define SFML_AUDIO_API SFML_API_EXPORT 40 | 41 | #else 42 | 43 | #define SFML_AUDIO_API SFML_API_IMPORT 44 | 45 | #endif 46 | 47 | 48 | #endif // SFML_AUDIO_EXPORT_HPP 49 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Audio/OutputSoundFile.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_OUTPUTSOUNDFILE_HPP 26 | #define SFML_OUTPUTSOUNDFILE_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | #include 34 | 35 | 36 | namespace sf 37 | { 38 | class SoundFileWriter; 39 | 40 | //////////////////////////////////////////////////////////// 41 | /// \brief Provide write access to sound files 42 | /// 43 | //////////////////////////////////////////////////////////// 44 | class SFML_AUDIO_API OutputSoundFile : NonCopyable 45 | { 46 | public: 47 | 48 | //////////////////////////////////////////////////////////// 49 | /// \brief Default constructor 50 | /// 51 | //////////////////////////////////////////////////////////// 52 | OutputSoundFile(); 53 | 54 | //////////////////////////////////////////////////////////// 55 | /// \brief Destructor 56 | /// 57 | /// Closes the file if it was still open. 58 | /// 59 | //////////////////////////////////////////////////////////// 60 | ~OutputSoundFile(); 61 | 62 | //////////////////////////////////////////////////////////// 63 | /// \brief Open the sound file from the disk for writing 64 | /// 65 | /// The supported audio formats are: WAV, OGG/Vorbis, FLAC. 66 | /// 67 | /// \param filename Path of the sound file to write 68 | /// \param sampleRate Sample rate of the sound 69 | /// \param channelCount Number of channels in the sound 70 | /// 71 | /// \return True if the file was successfully opened 72 | /// 73 | //////////////////////////////////////////////////////////// 74 | bool openFromFile(const std::string& filename, unsigned int sampleRate, unsigned int channelCount); 75 | 76 | //////////////////////////////////////////////////////////// 77 | /// \brief Write audio samples to the file 78 | /// 79 | /// \param samples Pointer to the sample array to write 80 | /// \param count Number of samples to write 81 | /// 82 | //////////////////////////////////////////////////////////// 83 | void write(const Int16* samples, Uint64 count); 84 | 85 | private: 86 | 87 | //////////////////////////////////////////////////////////// 88 | /// \brief Close the current file 89 | /// 90 | //////////////////////////////////////////////////////////// 91 | void close(); 92 | 93 | //////////////////////////////////////////////////////////// 94 | // Member data 95 | //////////////////////////////////////////////////////////// 96 | SoundFileWriter* m_writer; ///< Writer that handles I/O on the file's format 97 | }; 98 | 99 | } // namespace sf 100 | 101 | 102 | #endif // SFML_OUTPUTSOUNDFILE_HPP 103 | 104 | 105 | //////////////////////////////////////////////////////////// 106 | /// \class sf::OutputSoundFile 107 | /// \ingroup audio 108 | /// 109 | /// This class encodes audio samples to a sound file. It is 110 | /// used internally by higher-level classes such as sf::SoundBuffer, 111 | /// but can also be useful if you want to create audio files from 112 | /// custom data sources, like generated audio samples. 113 | /// 114 | /// Usage example: 115 | /// \code 116 | /// // Create a sound file, ogg/vorbis format, 44100 Hz, stereo 117 | /// sf::OutputSoundFile file; 118 | /// if (!file.openFromFile("music.ogg", 44100, 2)) 119 | /// /* error */; 120 | /// 121 | /// while (...) 122 | /// { 123 | /// // Read or generate audio samples from your custom source 124 | /// std::vector samples = ...; 125 | /// 126 | /// // Write them to the file 127 | /// file.write(samples.data(), samples.size()); 128 | /// } 129 | /// \endcode 130 | /// 131 | /// \see sf::SoundFileWriter, sf::InputSoundFile 132 | /// 133 | //////////////////////////////////////////////////////////// 134 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Audio/SoundFileFactory.inl: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | //////////////////////////////////////////////////////////// 26 | // Headers 27 | //////////////////////////////////////////////////////////// 28 | 29 | 30 | namespace sf 31 | { 32 | namespace priv 33 | { 34 | template SoundFileReader* createReader() {return new T;} 35 | template SoundFileWriter* createWriter() {return new T;} 36 | } 37 | 38 | //////////////////////////////////////////////////////////// 39 | template 40 | void SoundFileFactory::registerReader() 41 | { 42 | // Make sure the same class won't be registered twice 43 | unregisterReader(); 44 | 45 | // Create a new factory with the functions provided by the class 46 | ReaderFactory factory; 47 | factory.check = &T::check; 48 | factory.create = &priv::createReader; 49 | 50 | // Add it 51 | s_readers.push_back(factory); 52 | } 53 | 54 | 55 | //////////////////////////////////////////////////////////// 56 | template 57 | void SoundFileFactory::unregisterReader() 58 | { 59 | // Remove the instance(s) of the reader from the array of factories 60 | for (ReaderFactoryArray::iterator it = s_readers.begin(); it != s_readers.end(); ) 61 | { 62 | if (it->create == &priv::createReader) 63 | it = s_readers.erase(it); 64 | else 65 | ++it; 66 | } 67 | } 68 | 69 | //////////////////////////////////////////////////////////// 70 | template 71 | void SoundFileFactory::registerWriter() 72 | { 73 | // Make sure the same class won't be registered twice 74 | unregisterWriter(); 75 | 76 | // Create a new factory with the functions provided by the class 77 | WriterFactory factory; 78 | factory.check = &T::check; 79 | factory.create = &priv::createWriter; 80 | 81 | // Add it 82 | s_writers.push_back(factory); 83 | } 84 | 85 | 86 | //////////////////////////////////////////////////////////// 87 | template 88 | void SoundFileFactory::unregisterWriter() 89 | { 90 | // Remove the instance(s) of the writer from the array of factories 91 | for (WriterFactoryArray::iterator it = s_writers.begin(); it != s_writers.end(); ) 92 | { 93 | if (it->create == &priv::createWriter) 94 | it = s_writers.erase(it); 95 | else 96 | ++it; 97 | } 98 | } 99 | 100 | } // namespace sf 101 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Audio/SoundFileWriter.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_SOUNDFILEWRITER_HPP 26 | #define SFML_SOUNDFILEWRITER_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | //////////////////////////////////////////////////////////// 38 | /// \brief Abstract base class for sound file encoding 39 | /// 40 | //////////////////////////////////////////////////////////// 41 | class SFML_AUDIO_API SoundFileWriter 42 | { 43 | public: 44 | 45 | //////////////////////////////////////////////////////////// 46 | /// \brief Virtual destructor 47 | /// 48 | //////////////////////////////////////////////////////////// 49 | virtual ~SoundFileWriter() {} 50 | 51 | //////////////////////////////////////////////////////////// 52 | /// \brief Open a sound file for writing 53 | /// 54 | /// \param filename Path of the file to open 55 | /// \param sampleRate Sample rate of the sound 56 | /// \param channelCount Number of channels of the sound 57 | /// 58 | /// \return True if the file was successfully opened 59 | /// 60 | //////////////////////////////////////////////////////////// 61 | virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount) = 0; 62 | 63 | //////////////////////////////////////////////////////////// 64 | /// \brief Write audio samples to the open file 65 | /// 66 | /// \param samples Pointer to the sample array to write 67 | /// \param count Number of samples to write 68 | /// 69 | //////////////////////////////////////////////////////////// 70 | virtual void write(const Int16* samples, Uint64 count) = 0; 71 | }; 72 | 73 | } // namespace sf 74 | 75 | 76 | #endif // SFML_SOUNDFILEWRITER_HPP 77 | 78 | 79 | //////////////////////////////////////////////////////////// 80 | /// \class sf::SoundFileWriter 81 | /// \ingroup audio 82 | /// 83 | /// This class allows users to write audio file formats not natively 84 | /// supported by SFML, and thus extend the set of supported writable 85 | /// audio formats. 86 | /// 87 | /// A valid sound file writer must override the open and write functions, 88 | /// as well as providing a static check function; the latter is used by 89 | /// SFML to find a suitable writer for a given filename. 90 | /// 91 | /// To register a new writer, use the sf::SoundFileFactory::registerWriter 92 | /// template function. 93 | /// 94 | /// Usage example: 95 | /// \code 96 | /// class MySoundFileWriter : public sf::SoundFileWriter 97 | /// { 98 | /// public: 99 | /// 100 | /// static bool check(const std::string& filename) 101 | /// { 102 | /// // typically, check the extension 103 | /// // return true if the writer can handle the format 104 | /// } 105 | /// 106 | /// virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount) 107 | /// { 108 | /// // open the file 'filename' for writing, 109 | /// // write the given sample rate and channel count to the file header 110 | /// // return true on success 111 | /// } 112 | /// 113 | /// virtual void write(const sf::Int16* samples, sf::Uint64 count) 114 | /// { 115 | /// // write 'count' samples stored at address 'samples', 116 | /// // convert them (for example to normalized float) if the format requires it 117 | /// } 118 | /// }; 119 | /// 120 | /// sf::SoundFileFactory::registerWriter(); 121 | /// \endcode 122 | /// 123 | /// \see sf::OutputSoundFile, sf::SoundFileFactory, sf::SoundFileReader 124 | /// 125 | //////////////////////////////////////////////////////////// 126 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/GpuPreference.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_GPUPREFERENCE_HPP 26 | #define SFML_GPUPREFERENCE_HPP 27 | 28 | 29 | //////////////////////////////////////////////////////////// 30 | /// Headers 31 | //////////////////////////////////////////////////////////// 32 | #include 33 | 34 | 35 | //////////////////////////////////////////////////////////// 36 | /// \file 37 | /// 38 | /// \brief File containing SFML_DEFINE_DISCRETE_GPU_PREFERENCE 39 | /// 40 | //////////////////////////////////////////////////////////// 41 | 42 | 43 | //////////////////////////////////////////////////////////// 44 | /// \def SFML_DEFINE_DISCRETE_GPU_PREFERENCE 45 | /// 46 | /// \brief A macro to encourage usage of the discrete GPU 47 | /// 48 | /// In order to inform the Nvidia/AMD driver that an SFML 49 | /// application could benefit from using the more powerful 50 | /// discrete GPU, special symbols have to be publicly 51 | /// exported from the final executable. 52 | /// 53 | /// SFML defines a helper macro to easily do this. 54 | /// 55 | /// Place SFML_DEFINE_DISCRETE_GPU_PREFERENCE in the 56 | /// global scope of a source file that will be linked into 57 | /// the final executable. Typically it is best to place it 58 | /// where the main function is also defined. 59 | /// 60 | //////////////////////////////////////////////////////////// 61 | #if defined(SFML_SYSTEM_WINDOWS) 62 | 63 | #define SFML_DEFINE_DISCRETE_GPU_PREFERENCE \ 64 | extern "C" __declspec(dllexport) unsigned long NvOptimusEnablement = 1; \ 65 | extern "C" __declspec(dllexport) unsigned long AmdPowerXpressRequestHighPerformance = 1; 66 | 67 | #else 68 | 69 | #define SFML_DEFINE_DISCRETE_GPU_PREFERENCE 70 | 71 | #endif 72 | 73 | 74 | #endif // SFML_GPUPREFERENCE_HPP 75 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Graphics.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_GRAPHICS_HPP 26 | #define SFML_GRAPHICS_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | 60 | 61 | #endif // SFML_GRAPHICS_HPP 62 | 63 | //////////////////////////////////////////////////////////// 64 | /// \defgroup graphics Graphics module 65 | /// 66 | /// 2D graphics module: sprites, text, shapes, ... 67 | /// 68 | //////////////////////////////////////////////////////////// 69 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Graphics/Drawable.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_DRAWABLE_HPP 26 | #define SFML_DRAWABLE_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | class RenderTarget; 38 | 39 | //////////////////////////////////////////////////////////// 40 | /// \brief Abstract base class for objects that can be drawn 41 | /// to a render target 42 | /// 43 | //////////////////////////////////////////////////////////// 44 | class SFML_GRAPHICS_API Drawable 45 | { 46 | public: 47 | 48 | //////////////////////////////////////////////////////////// 49 | /// \brief Virtual destructor 50 | /// 51 | //////////////////////////////////////////////////////////// 52 | virtual ~Drawable() {} 53 | 54 | protected: 55 | 56 | friend class RenderTarget; 57 | 58 | //////////////////////////////////////////////////////////// 59 | /// \brief Draw the object to a render target 60 | /// 61 | /// This is a pure virtual function that has to be implemented 62 | /// by the derived class to define how the drawable should be 63 | /// drawn. 64 | /// 65 | /// \param target Render target to draw to 66 | /// \param states Current render states 67 | /// 68 | //////////////////////////////////////////////////////////// 69 | virtual void draw(RenderTarget& target, RenderStates states) const = 0; 70 | }; 71 | 72 | } // namespace sf 73 | 74 | 75 | #endif // SFML_DRAWABLE_HPP 76 | 77 | 78 | //////////////////////////////////////////////////////////// 79 | /// \class sf::Drawable 80 | /// \ingroup graphics 81 | /// 82 | /// sf::Drawable is a very simple base class that allows objects 83 | /// of derived classes to be drawn to a sf::RenderTarget. 84 | /// 85 | /// All you have to do in your derived class is to override the 86 | /// draw virtual function. 87 | /// 88 | /// Note that inheriting from sf::Drawable is not mandatory, 89 | /// but it allows this nice syntax "window.draw(object)" rather 90 | /// than "object.draw(window)", which is more consistent with other 91 | /// SFML classes. 92 | /// 93 | /// Example: 94 | /// \code 95 | /// class MyDrawable : public sf::Drawable 96 | /// { 97 | /// public: 98 | /// 99 | /// ... 100 | /// 101 | /// private: 102 | /// 103 | /// virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const 104 | /// { 105 | /// // You can draw other high-level objects 106 | /// target.draw(m_sprite, states); 107 | /// 108 | /// // ... or use the low-level API 109 | /// states.texture = &m_texture; 110 | /// target.draw(m_vertices, states); 111 | /// 112 | /// // ... or draw with OpenGL directly 113 | /// glBegin(GL_QUADS); 114 | /// ... 115 | /// glEnd(); 116 | /// } 117 | /// 118 | /// sf::Sprite m_sprite; 119 | /// sf::Texture m_texture; 120 | /// sf::VertexArray m_vertices; 121 | /// }; 122 | /// \endcode 123 | /// 124 | /// \see sf::RenderTarget 125 | /// 126 | //////////////////////////////////////////////////////////// 127 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Graphics/Export.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_GRAPHICS_EXPORT_HPP 26 | #define SFML_GRAPHICS_EXPORT_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | //////////////////////////////////////////////////////////// 35 | // Define portable import / export macros 36 | //////////////////////////////////////////////////////////// 37 | #if defined(SFML_GRAPHICS_EXPORTS) 38 | 39 | #define SFML_GRAPHICS_API SFML_API_EXPORT 40 | 41 | #else 42 | 43 | #define SFML_GRAPHICS_API SFML_API_IMPORT 44 | 45 | #endif 46 | 47 | 48 | #endif // SFML_GRAPHICS_EXPORT_HPP 49 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Graphics/Glyph.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_GLYPH_HPP 26 | #define SFML_GLYPH_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | //////////////////////////////////////////////////////////// 38 | /// \brief Structure describing a glyph 39 | /// 40 | //////////////////////////////////////////////////////////// 41 | class SFML_GRAPHICS_API Glyph 42 | { 43 | public: 44 | 45 | //////////////////////////////////////////////////////////// 46 | /// \brief Default constructor 47 | /// 48 | //////////////////////////////////////////////////////////// 49 | Glyph() : advance(0) {} 50 | 51 | //////////////////////////////////////////////////////////// 52 | // Member data 53 | //////////////////////////////////////////////////////////// 54 | float advance; ///< Offset to move horizontally to the next character 55 | FloatRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline 56 | IntRect textureRect; ///< Texture coordinates of the glyph inside the font's texture 57 | }; 58 | 59 | } // namespace sf 60 | 61 | 62 | #endif // SFML_GLYPH_HPP 63 | 64 | 65 | //////////////////////////////////////////////////////////// 66 | /// \class sf::Glyph 67 | /// \ingroup graphics 68 | /// 69 | /// A glyph is the visual representation of a character. 70 | /// 71 | /// The sf::Glyph structure provides the information needed 72 | /// to handle the glyph: 73 | /// \li its coordinates in the font's texture 74 | /// \li its bounding rectangle 75 | /// \li the offset to apply to get the starting position of the next glyph 76 | /// 77 | /// \see sf::Font 78 | /// 79 | //////////////////////////////////////////////////////////// 80 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Graphics/PrimitiveType.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_PRIMITIVETYPE_HPP 26 | #define SFML_PRIMITIVETYPE_HPP 27 | 28 | namespace sf 29 | { 30 | //////////////////////////////////////////////////////////// 31 | /// \ingroup graphics 32 | /// \brief Types of primitives that a sf::VertexArray can render 33 | /// 34 | /// Points and lines have no area, therefore their thickness 35 | /// will always be 1 pixel, regardless the current transform 36 | /// and view. 37 | /// 38 | //////////////////////////////////////////////////////////// 39 | enum PrimitiveType 40 | { 41 | Points, ///< List of individual points 42 | Lines, ///< List of individual lines 43 | LineStrip, ///< List of connected lines, a point uses the previous point to form a line 44 | Triangles, ///< List of individual triangles 45 | TriangleStrip, ///< List of connected triangles, a point uses the two previous points to form a triangle 46 | TriangleFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle 47 | Quads, ///< List of individual quads (deprecated, don't work with OpenGL ES) 48 | 49 | // Deprecated names 50 | LinesStrip = LineStrip, ///< \deprecated Use LineStrip instead 51 | TrianglesStrip = TriangleStrip, ///< \deprecated Use TriangleStrip instead 52 | TrianglesFan = TriangleFan ///< \deprecated Use TriangleFan instead 53 | }; 54 | 55 | } // namespace sf 56 | 57 | 58 | #endif // SFML_PRIMITIVETYPE_HPP 59 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Graphics/RectangleShape.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_RECTANGLESHAPE_HPP 26 | #define SFML_RECTANGLESHAPE_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | //////////////////////////////////////////////////////////// 38 | /// \brief Specialized shape representing a rectangle 39 | /// 40 | //////////////////////////////////////////////////////////// 41 | class SFML_GRAPHICS_API RectangleShape : public Shape 42 | { 43 | public: 44 | 45 | //////////////////////////////////////////////////////////// 46 | /// \brief Default constructor 47 | /// 48 | /// \param size Size of the rectangle 49 | /// 50 | //////////////////////////////////////////////////////////// 51 | explicit RectangleShape(const Vector2f& size = Vector2f(0, 0)); 52 | 53 | //////////////////////////////////////////////////////////// 54 | /// \brief Set the size of the rectangle 55 | /// 56 | /// \param size New size of the rectangle 57 | /// 58 | /// \see getSize 59 | /// 60 | //////////////////////////////////////////////////////////// 61 | void setSize(const Vector2f& size); 62 | 63 | //////////////////////////////////////////////////////////// 64 | /// \brief Get the size of the rectangle 65 | /// 66 | /// \return Size of the rectangle 67 | /// 68 | /// \see setSize 69 | /// 70 | //////////////////////////////////////////////////////////// 71 | const Vector2f& getSize() const; 72 | 73 | //////////////////////////////////////////////////////////// 74 | /// \brief Get the number of points defining the shape 75 | /// 76 | /// \return Number of points of the shape. For rectangle 77 | /// shapes, this number is always 4. 78 | /// 79 | //////////////////////////////////////////////////////////// 80 | virtual std::size_t getPointCount() const; 81 | 82 | //////////////////////////////////////////////////////////// 83 | /// \brief Get a point of the rectangle 84 | /// 85 | /// The returned point is in local coordinates, that is, 86 | /// the shape's transforms (position, rotation, scale) are 87 | /// not taken into account. 88 | /// The result is undefined if \a index is out of the valid range. 89 | /// 90 | /// \param index Index of the point to get, in range [0 .. 3] 91 | /// 92 | /// \return index-th point of the shape 93 | /// 94 | //////////////////////////////////////////////////////////// 95 | virtual Vector2f getPoint(std::size_t index) const; 96 | 97 | private: 98 | 99 | //////////////////////////////////////////////////////////// 100 | // Member data 101 | //////////////////////////////////////////////////////////// 102 | Vector2f m_size; ///< Size of the rectangle 103 | }; 104 | 105 | } // namespace sf 106 | 107 | 108 | #endif // SFML_RECTANGLESHAPE_HPP 109 | 110 | 111 | //////////////////////////////////////////////////////////// 112 | /// \class sf::RectangleShape 113 | /// \ingroup graphics 114 | /// 115 | /// This class inherits all the functions of sf::Transformable 116 | /// (position, rotation, scale, bounds, ...) as well as the 117 | /// functions of sf::Shape (outline, color, texture, ...). 118 | /// 119 | /// Usage example: 120 | /// \code 121 | /// sf::RectangleShape rectangle; 122 | /// rectangle.setSize(sf::Vector2f(100, 50)); 123 | /// rectangle.setOutlineColor(sf::Color::Red); 124 | /// rectangle.setOutlineThickness(5); 125 | /// rectangle.setPosition(10, 20); 126 | /// ... 127 | /// window.draw(rectangle); 128 | /// \endcode 129 | /// 130 | /// \see sf::Shape, sf::CircleShape, sf::ConvexShape 131 | /// 132 | //////////////////////////////////////////////////////////// 133 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Main.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_MAIN_HPP 26 | #define SFML_MAIN_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | #if defined(SFML_SYSTEM_IOS) 35 | 36 | // On iOS, we have no choice but to have our own main, 37 | // so we need to rename the user one and call it later 38 | #define main sfmlMain 39 | 40 | #endif 41 | 42 | 43 | #endif // SFML_MAIN_HPP 44 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Network.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_NETWORK_HPP 26 | #define SFML_NETWORK_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | 45 | #endif // SFML_NETWORK_HPP 46 | 47 | //////////////////////////////////////////////////////////// 48 | /// \defgroup network Network module 49 | /// 50 | /// Socket-based communication, utilities and higher-level 51 | /// network protocols (HTTP, FTP). 52 | /// 53 | //////////////////////////////////////////////////////////// 54 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Network/Export.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_NETWORK_EXPORT_HPP 26 | #define SFML_NETWORK_EXPORT_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | //////////////////////////////////////////////////////////// 35 | // Define portable import / export macros 36 | //////////////////////////////////////////////////////////// 37 | #if defined(SFML_NETWORK_EXPORTS) 38 | 39 | #define SFML_NETWORK_API SFML_API_EXPORT 40 | 41 | #else 42 | 43 | #define SFML_NETWORK_API SFML_API_IMPORT 44 | 45 | #endif 46 | 47 | 48 | #endif // SFML_NETWORK_EXPORT_HPP 49 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Network/SocketHandle.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_SOCKETHANDLE_HPP 26 | #define SFML_SOCKETHANDLE_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | #if defined(SFML_SYSTEM_WINDOWS) 34 | #include 35 | #endif 36 | 37 | 38 | namespace sf 39 | { 40 | //////////////////////////////////////////////////////////// 41 | // Define the low-level socket handle type, specific to 42 | // each platform 43 | //////////////////////////////////////////////////////////// 44 | #if defined(SFML_SYSTEM_WINDOWS) 45 | 46 | typedef UINT_PTR SocketHandle; 47 | 48 | #else 49 | 50 | typedef int SocketHandle; 51 | 52 | #endif 53 | 54 | } // namespace sf 55 | 56 | 57 | #endif // SFML_SOCKETHANDLE_HPP 58 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/OpenGL.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_OPENGL_HPP 26 | #define SFML_OPENGL_HPP 27 | 28 | 29 | //////////////////////////////////////////////////////////// 30 | /// Headers 31 | //////////////////////////////////////////////////////////// 32 | #include 33 | 34 | 35 | //////////////////////////////////////////////////////////// 36 | /// This file just includes the OpenGL headers, 37 | /// which have actually different paths on each system 38 | //////////////////////////////////////////////////////////// 39 | #if defined(SFML_SYSTEM_WINDOWS) 40 | 41 | // The Visual C++ version of gl.h uses WINGDIAPI and APIENTRY but doesn't define them 42 | #ifdef _MSC_VER 43 | #include 44 | #endif 45 | 46 | #include 47 | 48 | #elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD) || defined(SFML_SYSTEM_OPENBSD) 49 | 50 | #if defined(SFML_OPENGL_ES) 51 | #include 52 | #include 53 | #else 54 | #include 55 | #endif 56 | 57 | #elif defined(SFML_SYSTEM_MACOS) 58 | 59 | #include 60 | 61 | #elif defined (SFML_SYSTEM_IOS) 62 | 63 | #include 64 | #include 65 | 66 | #elif defined (SFML_SYSTEM_ANDROID) 67 | 68 | #include 69 | #include 70 | 71 | // We're not using OpenGL ES 2+ yet, but we can use the sRGB extension 72 | #include 73 | #include 74 | 75 | #endif 76 | 77 | 78 | #endif // SFML_OPENGL_HPP 79 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_SYSTEM_HPP 26 | #define SFML_SYSTEM_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | 51 | #endif // SFML_SYSTEM_HPP 52 | 53 | //////////////////////////////////////////////////////////// 54 | /// \defgroup system System module 55 | /// 56 | /// Base module of SFML, defining various utilities. It provides 57 | /// vector classes, Unicode strings and conversion functions, 58 | /// threads and mutexes, timing classes. 59 | /// 60 | //////////////////////////////////////////////////////////// 61 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/Clock.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_CLOCK_HPP 26 | #define SFML_CLOCK_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | //////////////////////////////////////////////////////////// 38 | /// \brief Utility class that measures the elapsed time 39 | /// 40 | //////////////////////////////////////////////////////////// 41 | class SFML_SYSTEM_API Clock 42 | { 43 | public: 44 | 45 | //////////////////////////////////////////////////////////// 46 | /// \brief Default constructor 47 | /// 48 | /// The clock starts automatically after being constructed. 49 | /// 50 | //////////////////////////////////////////////////////////// 51 | Clock(); 52 | 53 | //////////////////////////////////////////////////////////// 54 | /// \brief Get the elapsed time 55 | /// 56 | /// This function returns the time elapsed since the last call 57 | /// to restart() (or the construction of the instance if restart() 58 | /// has not been called). 59 | /// 60 | /// \return Time elapsed 61 | /// 62 | //////////////////////////////////////////////////////////// 63 | Time getElapsedTime() const; 64 | 65 | //////////////////////////////////////////////////////////// 66 | /// \brief Restart the clock 67 | /// 68 | /// This function puts the time counter back to zero. 69 | /// It also returns the time elapsed since the clock was started. 70 | /// 71 | /// \return Time elapsed 72 | /// 73 | //////////////////////////////////////////////////////////// 74 | Time restart(); 75 | 76 | private: 77 | 78 | //////////////////////////////////////////////////////////// 79 | // Member data 80 | //////////////////////////////////////////////////////////// 81 | Time m_startTime; ///< Time of last reset, in microseconds 82 | }; 83 | 84 | } // namespace sf 85 | 86 | 87 | #endif // SFML_CLOCK_HPP 88 | 89 | 90 | //////////////////////////////////////////////////////////// 91 | /// \class sf::Clock 92 | /// \ingroup system 93 | /// 94 | /// sf::Clock is a lightweight class for measuring time. 95 | /// 96 | /// Its provides the most precise time that the underlying 97 | /// OS can achieve (generally microseconds or nanoseconds). 98 | /// It also ensures monotonicity, which means that the returned 99 | /// time can never go backward, even if the system time is 100 | /// changed. 101 | /// 102 | /// Usage example: 103 | /// \code 104 | /// sf::Clock clock; 105 | /// ... 106 | /// Time time1 = clock.getElapsedTime(); 107 | /// ... 108 | /// Time time2 = clock.restart(); 109 | /// \endcode 110 | /// 111 | /// The sf::Time value returned by the clock can then be 112 | /// converted to a number of seconds, milliseconds or even 113 | /// microseconds. 114 | /// 115 | /// \see sf::Time 116 | /// 117 | //////////////////////////////////////////////////////////// 118 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/Err.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_ERR_HPP 26 | #define SFML_ERR_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | //////////////////////////////////////////////////////////// 38 | /// \brief Standard stream used by SFML to output warnings and errors 39 | /// 40 | //////////////////////////////////////////////////////////// 41 | SFML_SYSTEM_API std::ostream& err(); 42 | 43 | } // namespace sf 44 | 45 | 46 | #endif // SFML_ERR_HPP 47 | 48 | 49 | //////////////////////////////////////////////////////////// 50 | /// \fn sf::err 51 | /// \ingroup system 52 | /// 53 | /// By default, sf::err() outputs to the same location as std::cerr, 54 | /// (-> the stderr descriptor) which is the console if there's 55 | /// one available. 56 | /// 57 | /// It is a standard std::ostream instance, so it supports all the 58 | /// insertion operations defined by the STL 59 | /// (operator <<, manipulators, etc.). 60 | /// 61 | /// sf::err() can be redirected to write to another output, independently 62 | /// of std::cerr, by using the rdbuf() function provided by the 63 | /// std::ostream class. 64 | /// 65 | /// Example: 66 | /// \code 67 | /// // Redirect to a file 68 | /// std::ofstream file("sfml-log.txt"); 69 | /// std::streambuf* previous = sf::err().rdbuf(file.rdbuf()); 70 | /// 71 | /// // Redirect to nothing 72 | /// sf::err().rdbuf(NULL); 73 | /// 74 | /// // Restore the original output 75 | /// sf::err().rdbuf(previous); 76 | /// \endcode 77 | /// 78 | /// \return Reference to std::ostream representing the SFML error stream 79 | /// 80 | //////////////////////////////////////////////////////////// 81 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/Export.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_SYSTEM_EXPORT_HPP 26 | #define SFML_SYSTEM_EXPORT_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | //////////////////////////////////////////////////////////// 35 | // Define portable import / export macros 36 | //////////////////////////////////////////////////////////// 37 | #if defined(SFML_SYSTEM_EXPORTS) 38 | 39 | #define SFML_SYSTEM_API SFML_API_EXPORT 40 | 41 | #else 42 | 43 | #define SFML_SYSTEM_API SFML_API_IMPORT 44 | 45 | #endif 46 | 47 | 48 | #endif // SFML_SYSTEM_EXPORT_HPP 49 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/Lock.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_LOCK_HPP 26 | #define SFML_LOCK_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | class Mutex; 38 | 39 | //////////////////////////////////////////////////////////// 40 | /// \brief Automatic wrapper for locking and unlocking mutexes 41 | /// 42 | //////////////////////////////////////////////////////////// 43 | class SFML_SYSTEM_API Lock : NonCopyable 44 | { 45 | public: 46 | 47 | //////////////////////////////////////////////////////////// 48 | /// \brief Construct the lock with a target mutex 49 | /// 50 | /// The mutex passed to sf::Lock is automatically locked. 51 | /// 52 | /// \param mutex Mutex to lock 53 | /// 54 | //////////////////////////////////////////////////////////// 55 | explicit Lock(Mutex& mutex); 56 | 57 | //////////////////////////////////////////////////////////// 58 | /// \brief Destructor 59 | /// 60 | /// The destructor of sf::Lock automatically unlocks its mutex. 61 | /// 62 | //////////////////////////////////////////////////////////// 63 | ~Lock(); 64 | 65 | private: 66 | 67 | //////////////////////////////////////////////////////////// 68 | // Member data 69 | //////////////////////////////////////////////////////////// 70 | Mutex& m_mutex; ///< Mutex to lock / unlock 71 | }; 72 | 73 | } // namespace sf 74 | 75 | 76 | #endif // SFML_LOCK_HPP 77 | 78 | 79 | //////////////////////////////////////////////////////////// 80 | /// \class sf::Lock 81 | /// \ingroup system 82 | /// 83 | /// sf::Lock is a RAII wrapper for sf::Mutex. By unlocking 84 | /// it in its destructor, it ensures that the mutex will 85 | /// always be released when the current scope (most likely 86 | /// a function) ends. 87 | /// This is even more important when an exception or an early 88 | /// return statement can interrupt the execution flow of the 89 | /// function. 90 | /// 91 | /// For maximum robustness, sf::Lock should always be used 92 | /// to lock/unlock a mutex. 93 | /// 94 | /// Usage example: 95 | /// \code 96 | /// sf::Mutex mutex; 97 | /// 98 | /// void function() 99 | /// { 100 | /// sf::Lock lock(mutex); // mutex is now locked 101 | /// 102 | /// functionThatMayThrowAnException(); // mutex is unlocked if this function throws 103 | /// 104 | /// if (someCondition) 105 | /// return; // mutex is unlocked 106 | /// 107 | /// } // mutex is unlocked 108 | /// \endcode 109 | /// 110 | /// Because the mutex is not explicitly unlocked in the code, 111 | /// it may remain locked longer than needed. If the region 112 | /// of the code that needs to be protected by the mutex is 113 | /// not the entire function, a good practice is to create a 114 | /// smaller, inner scope so that the lock is limited to this 115 | /// part of the code. 116 | /// 117 | /// \code 118 | /// sf::Mutex mutex; 119 | /// 120 | /// void function() 121 | /// { 122 | /// { 123 | /// sf::Lock lock(mutex); 124 | /// codeThatRequiresProtection(); 125 | /// 126 | /// } // mutex is unlocked here 127 | /// 128 | /// codeThatDoesntCareAboutTheMutex(); 129 | /// } 130 | /// \endcode 131 | /// 132 | /// Having a mutex locked longer than required is a bad practice 133 | /// which can lead to bad performances. Don't forget that when 134 | /// a mutex is locked, other threads may be waiting doing nothing 135 | /// until it is released. 136 | /// 137 | /// \see sf::Mutex 138 | /// 139 | //////////////////////////////////////////////////////////// 140 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/NativeActivity.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_NATIVEACTIVITY_HPP 26 | #define SFML_NATIVEACTIVITY_HPP 27 | 28 | 29 | //////////////////////////////////////////////////////////// 30 | // Headers 31 | //////////////////////////////////////////////////////////// 32 | #include 33 | 34 | 35 | #if !defined(SFML_SYSTEM_ANDROID) 36 | #error NativeActivity.hpp: This header is Android only. 37 | #endif 38 | 39 | 40 | struct ANativeActivity; 41 | 42 | namespace sf 43 | { 44 | //////////////////////////////////////////////////////////// 45 | /// \ingroup system 46 | /// \brief Return a pointer to the Android native activity 47 | /// 48 | /// You shouldn't have to use this function, unless you want 49 | /// to implement very specific details, that SFML doesn't 50 | /// support, or to use a workaround for a known issue. 51 | /// 52 | /// \return Pointer to Android native activity structure 53 | /// 54 | /// \sfplatform{Android,SFML/System/NativeActivity.hpp} 55 | /// 56 | //////////////////////////////////////////////////////////// 57 | SFML_SYSTEM_API ANativeActivity* getNativeActivity(); 58 | 59 | } // namespace sf 60 | 61 | 62 | #endif // SFML_NATIVEACTIVITY_HPP 63 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/NonCopyable.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_NONCOPYABLE_HPP 26 | #define SFML_NONCOPYABLE_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | namespace sf 35 | { 36 | //////////////////////////////////////////////////////////// 37 | /// \brief Utility class that makes any derived 38 | /// class non-copyable 39 | /// 40 | //////////////////////////////////////////////////////////// 41 | class SFML_SYSTEM_API NonCopyable 42 | { 43 | protected: 44 | 45 | //////////////////////////////////////////////////////////// 46 | /// \brief Default constructor 47 | /// 48 | /// Because this class has a copy constructor, the compiler 49 | /// will not automatically generate the default constructor. 50 | /// That's why we must define it explicitly. 51 | /// 52 | //////////////////////////////////////////////////////////// 53 | NonCopyable() {} 54 | 55 | //////////////////////////////////////////////////////////// 56 | /// \brief Default destructor 57 | /// 58 | /// By declaring a protected destructor it's impossible to 59 | /// call delete on a pointer of sf::NonCopyable, thus 60 | /// preventing possible resource leaks. 61 | /// 62 | //////////////////////////////////////////////////////////// 63 | ~NonCopyable() {} 64 | 65 | private: 66 | 67 | //////////////////////////////////////////////////////////// 68 | /// \brief Disabled copy constructor 69 | /// 70 | /// By making the copy constructor private, the compiler will 71 | /// trigger an error if anyone outside tries to use it. 72 | /// To prevent NonCopyable or friend classes from using it, 73 | /// we also give no definition, so that the linker will 74 | /// produce an error if the first protection was inefficient. 75 | /// 76 | //////////////////////////////////////////////////////////// 77 | NonCopyable(const NonCopyable&); 78 | 79 | //////////////////////////////////////////////////////////// 80 | /// \brief Disabled assignment operator 81 | /// 82 | /// By making the assignment operator private, the compiler will 83 | /// trigger an error if anyone outside tries to use it. 84 | /// To prevent NonCopyable or friend classes from using it, 85 | /// we also give no definition, so that the linker will 86 | /// produce an error if the first protection was inefficient. 87 | /// 88 | //////////////////////////////////////////////////////////// 89 | NonCopyable& operator =(const NonCopyable&); 90 | }; 91 | 92 | } // namespace sf 93 | 94 | 95 | #endif // SFML_NONCOPYABLE_HPP 96 | 97 | 98 | //////////////////////////////////////////////////////////// 99 | /// \class sf::NonCopyable 100 | /// \ingroup system 101 | /// 102 | /// This class makes its instances non-copyable, by explicitly 103 | /// disabling its copy constructor and its assignment operator. 104 | /// 105 | /// To create a non-copyable class, simply inherit from 106 | /// sf::NonCopyable. 107 | /// 108 | /// The type of inheritance (public or private) doesn't matter, 109 | /// the copy constructor and assignment operator are declared private 110 | /// in sf::NonCopyable so they will end up being inaccessible in both 111 | /// cases. Thus you can use a shorter syntax for inheriting from it 112 | /// (see below). 113 | /// 114 | /// Usage example: 115 | /// \code 116 | /// class MyNonCopyableClass : sf::NonCopyable 117 | /// { 118 | /// ... 119 | /// }; 120 | /// \endcode 121 | /// 122 | /// Deciding whether the instances of a class can be copied 123 | /// or not is a very important design choice. You are strongly 124 | /// encouraged to think about it before writing a class, 125 | /// and to use sf::NonCopyable when necessary to prevent 126 | /// many potential future errors when using it. This is also 127 | /// a very important indication to users of your class. 128 | /// 129 | //////////////////////////////////////////////////////////// 130 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/Sleep.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_SLEEP_HPP 26 | #define SFML_SLEEP_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | //////////////////////////////////////////////////////////// 38 | /// \ingroup system 39 | /// \brief Make the current thread sleep for a given duration 40 | /// 41 | /// sf::sleep is the best way to block a program or one of its 42 | /// threads, as it doesn't consume any CPU power. 43 | /// 44 | /// \param duration Time to sleep 45 | /// 46 | //////////////////////////////////////////////////////////// 47 | void SFML_SYSTEM_API sleep(Time duration); 48 | 49 | } // namespace sf 50 | 51 | 52 | #endif // SFML_SLEEP_HPP 53 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/String.inl: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | 26 | //////////////////////////////////////////////////////////// 27 | template 28 | String String::fromUtf8(T begin, T end) 29 | { 30 | String string; 31 | Utf8::toUtf32(begin, end, std::back_inserter(string.m_string)); 32 | return string; 33 | } 34 | 35 | 36 | //////////////////////////////////////////////////////////// 37 | template 38 | String String::fromUtf16(T begin, T end) 39 | { 40 | String string; 41 | Utf16::toUtf32(begin, end, std::back_inserter(string.m_string)); 42 | return string; 43 | } 44 | 45 | 46 | //////////////////////////////////////////////////////////// 47 | template 48 | String String::fromUtf32(T begin, T end) 49 | { 50 | String string; 51 | string.m_string.assign(begin, end); 52 | return string; 53 | } 54 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/Thread.inl: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | namespace priv 26 | { 27 | // Base class for abstract thread functions 28 | struct ThreadFunc 29 | { 30 | virtual ~ThreadFunc() {} 31 | virtual void run() = 0; 32 | }; 33 | 34 | // Specialization using a functor (including free functions) with no argument 35 | template 36 | struct ThreadFunctor : ThreadFunc 37 | { 38 | ThreadFunctor(T functor) : m_functor(functor) {} 39 | virtual void run() {m_functor();} 40 | T m_functor; 41 | }; 42 | 43 | // Specialization using a functor (including free functions) with one argument 44 | template 45 | struct ThreadFunctorWithArg : ThreadFunc 46 | { 47 | ThreadFunctorWithArg(F function, A arg) : m_function(function), m_arg(arg) {} 48 | virtual void run() {m_function(m_arg);} 49 | F m_function; 50 | A m_arg; 51 | }; 52 | 53 | // Specialization using a member function 54 | template 55 | struct ThreadMemberFunc : ThreadFunc 56 | { 57 | ThreadMemberFunc(void(C::*function)(), C* object) : m_function(function), m_object(object) {} 58 | virtual void run() {(m_object->*m_function)();} 59 | void(C::*m_function)(); 60 | C* m_object; 61 | }; 62 | 63 | } // namespace priv 64 | 65 | 66 | //////////////////////////////////////////////////////////// 67 | template 68 | Thread::Thread(F functor) : 69 | m_impl (NULL), 70 | m_entryPoint(new priv::ThreadFunctor(functor)) 71 | { 72 | } 73 | 74 | 75 | //////////////////////////////////////////////////////////// 76 | template 77 | Thread::Thread(F function, A argument) : 78 | m_impl (NULL), 79 | m_entryPoint(new priv::ThreadFunctorWithArg(function, argument)) 80 | { 81 | } 82 | 83 | 84 | //////////////////////////////////////////////////////////// 85 | template 86 | Thread::Thread(void(C::*function)(), C* object) : 87 | m_impl (NULL), 88 | m_entryPoint(new priv::ThreadMemberFunc(function, object)) 89 | { 90 | } 91 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/ThreadLocal.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_THREADLOCAL_HPP 26 | #define SFML_THREADLOCAL_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | #include 34 | 35 | 36 | namespace sf 37 | { 38 | namespace priv 39 | { 40 | class ThreadLocalImpl; 41 | } 42 | 43 | //////////////////////////////////////////////////////////// 44 | /// \brief Defines variables with thread-local storage 45 | /// 46 | //////////////////////////////////////////////////////////// 47 | class SFML_SYSTEM_API ThreadLocal : NonCopyable 48 | { 49 | public: 50 | 51 | //////////////////////////////////////////////////////////// 52 | /// \brief Default constructor 53 | /// 54 | /// \param value Optional value to initialize the variable 55 | /// 56 | //////////////////////////////////////////////////////////// 57 | ThreadLocal(void* value = NULL); 58 | 59 | //////////////////////////////////////////////////////////// 60 | /// \brief Destructor 61 | /// 62 | //////////////////////////////////////////////////////////// 63 | ~ThreadLocal(); 64 | 65 | //////////////////////////////////////////////////////////// 66 | /// \brief Set the thread-specific value of the variable 67 | /// 68 | /// \param value Value of the variable for the current thread 69 | /// 70 | //////////////////////////////////////////////////////////// 71 | void setValue(void* value); 72 | 73 | //////////////////////////////////////////////////////////// 74 | /// \brief Retrieve the thread-specific value of the variable 75 | /// 76 | /// \return Value of the variable for the current thread 77 | /// 78 | //////////////////////////////////////////////////////////// 79 | void* getValue() const; 80 | 81 | private: 82 | 83 | //////////////////////////////////////////////////////////// 84 | // Member data 85 | //////////////////////////////////////////////////////////// 86 | priv::ThreadLocalImpl* m_impl; ///< Pointer to the OS specific implementation 87 | }; 88 | 89 | } // namespace sf 90 | 91 | 92 | #endif // SFML_THREADLOCAL_HPP 93 | 94 | 95 | //////////////////////////////////////////////////////////// 96 | /// \class sf::ThreadLocal 97 | /// \ingroup system 98 | /// 99 | /// This class manipulates void* parameters and thus is not 100 | /// appropriate for strongly-typed variables. You should rather 101 | /// use the sf::ThreadLocalPtr template class. 102 | /// 103 | //////////////////////////////////////////////////////////// 104 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/ThreadLocalPtr.inl: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | 26 | namespace sf 27 | { 28 | //////////////////////////////////////////////////////////// 29 | template 30 | ThreadLocalPtr::ThreadLocalPtr(T* value) : 31 | ThreadLocal(value) 32 | { 33 | } 34 | 35 | 36 | //////////////////////////////////////////////////////////// 37 | template 38 | T& ThreadLocalPtr::operator *() const 39 | { 40 | return *static_cast(getValue()); 41 | } 42 | 43 | 44 | //////////////////////////////////////////////////////////// 45 | template 46 | T* ThreadLocalPtr::operator ->() const 47 | { 48 | return static_cast(getValue()); 49 | } 50 | 51 | 52 | //////////////////////////////////////////////////////////// 53 | template 54 | ThreadLocalPtr::operator T*() const 55 | { 56 | return static_cast(getValue()); 57 | } 58 | 59 | 60 | //////////////////////////////////////////////////////////// 61 | template 62 | ThreadLocalPtr& ThreadLocalPtr::operator =(T* value) 63 | { 64 | setValue(value); 65 | return *this; 66 | } 67 | 68 | 69 | //////////////////////////////////////////////////////////// 70 | template 71 | ThreadLocalPtr& ThreadLocalPtr::operator =(const ThreadLocalPtr& right) 72 | { 73 | setValue(right.getValue()); 74 | return *this; 75 | } 76 | 77 | } // namespace sf 78 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/Vector2.inl: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | 26 | //////////////////////////////////////////////////////////// 27 | template 28 | inline Vector2::Vector2() : 29 | x(0), 30 | y(0) 31 | { 32 | 33 | } 34 | 35 | 36 | //////////////////////////////////////////////////////////// 37 | template 38 | inline Vector2::Vector2(T X, T Y) : 39 | x(X), 40 | y(Y) 41 | { 42 | 43 | } 44 | 45 | 46 | //////////////////////////////////////////////////////////// 47 | template 48 | template 49 | inline Vector2::Vector2(const Vector2& vector) : 50 | x(static_cast(vector.x)), 51 | y(static_cast(vector.y)) 52 | { 53 | } 54 | 55 | 56 | //////////////////////////////////////////////////////////// 57 | template 58 | inline Vector2 operator -(const Vector2& right) 59 | { 60 | return Vector2(-right.x, -right.y); 61 | } 62 | 63 | 64 | //////////////////////////////////////////////////////////// 65 | template 66 | inline Vector2& operator +=(Vector2& left, const Vector2& right) 67 | { 68 | left.x += right.x; 69 | left.y += right.y; 70 | 71 | return left; 72 | } 73 | 74 | 75 | //////////////////////////////////////////////////////////// 76 | template 77 | inline Vector2& operator -=(Vector2& left, const Vector2& right) 78 | { 79 | left.x -= right.x; 80 | left.y -= right.y; 81 | 82 | return left; 83 | } 84 | 85 | 86 | //////////////////////////////////////////////////////////// 87 | template 88 | inline Vector2 operator +(const Vector2& left, const Vector2& right) 89 | { 90 | return Vector2(left.x + right.x, left.y + right.y); 91 | } 92 | 93 | 94 | //////////////////////////////////////////////////////////// 95 | template 96 | inline Vector2 operator -(const Vector2& left, const Vector2& right) 97 | { 98 | return Vector2(left.x - right.x, left.y - right.y); 99 | } 100 | 101 | 102 | //////////////////////////////////////////////////////////// 103 | template 104 | inline Vector2 operator *(const Vector2& left, T right) 105 | { 106 | return Vector2(left.x * right, left.y * right); 107 | } 108 | 109 | 110 | //////////////////////////////////////////////////////////// 111 | template 112 | inline Vector2 operator *(T left, const Vector2& right) 113 | { 114 | return Vector2(right.x * left, right.y * left); 115 | } 116 | 117 | 118 | //////////////////////////////////////////////////////////// 119 | template 120 | inline Vector2& operator *=(Vector2& left, T right) 121 | { 122 | left.x *= right; 123 | left.y *= right; 124 | 125 | return left; 126 | } 127 | 128 | 129 | //////////////////////////////////////////////////////////// 130 | template 131 | inline Vector2 operator /(const Vector2& left, T right) 132 | { 133 | return Vector2(left.x / right, left.y / right); 134 | } 135 | 136 | 137 | //////////////////////////////////////////////////////////// 138 | template 139 | inline Vector2& operator /=(Vector2& left, T right) 140 | { 141 | left.x /= right; 142 | left.y /= right; 143 | 144 | return left; 145 | } 146 | 147 | 148 | //////////////////////////////////////////////////////////// 149 | template 150 | inline bool operator ==(const Vector2& left, const Vector2& right) 151 | { 152 | return (left.x == right.x) && (left.y == right.y); 153 | } 154 | 155 | 156 | //////////////////////////////////////////////////////////// 157 | template 158 | inline bool operator !=(const Vector2& left, const Vector2& right) 159 | { 160 | return (left.x != right.x) || (left.y != right.y); 161 | } 162 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/System/Vector3.inl: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | 26 | //////////////////////////////////////////////////////////// 27 | template 28 | inline Vector3::Vector3() : 29 | x(0), 30 | y(0), 31 | z(0) 32 | { 33 | 34 | } 35 | 36 | 37 | //////////////////////////////////////////////////////////// 38 | template 39 | inline Vector3::Vector3(T X, T Y, T Z) : 40 | x(X), 41 | y(Y), 42 | z(Z) 43 | { 44 | 45 | } 46 | 47 | 48 | //////////////////////////////////////////////////////////// 49 | template 50 | template 51 | inline Vector3::Vector3(const Vector3& vector) : 52 | x(static_cast(vector.x)), 53 | y(static_cast(vector.y)), 54 | z(static_cast(vector.z)) 55 | { 56 | } 57 | 58 | 59 | //////////////////////////////////////////////////////////// 60 | template 61 | inline Vector3 operator -(const Vector3& left) 62 | { 63 | return Vector3(-left.x, -left.y, -left.z); 64 | } 65 | 66 | 67 | //////////////////////////////////////////////////////////// 68 | template 69 | inline Vector3& operator +=(Vector3& left, const Vector3& right) 70 | { 71 | left.x += right.x; 72 | left.y += right.y; 73 | left.z += right.z; 74 | 75 | return left; 76 | } 77 | 78 | 79 | //////////////////////////////////////////////////////////// 80 | template 81 | inline Vector3& operator -=(Vector3& left, const Vector3& right) 82 | { 83 | left.x -= right.x; 84 | left.y -= right.y; 85 | left.z -= right.z; 86 | 87 | return left; 88 | } 89 | 90 | 91 | //////////////////////////////////////////////////////////// 92 | template 93 | inline Vector3 operator +(const Vector3& left, const Vector3& right) 94 | { 95 | return Vector3(left.x + right.x, left.y + right.y, left.z + right.z); 96 | } 97 | 98 | 99 | //////////////////////////////////////////////////////////// 100 | template 101 | inline Vector3 operator -(const Vector3& left, const Vector3& right) 102 | { 103 | return Vector3(left.x - right.x, left.y - right.y, left.z - right.z); 104 | } 105 | 106 | 107 | //////////////////////////////////////////////////////////// 108 | template 109 | inline Vector3 operator *(const Vector3& left, T right) 110 | { 111 | return Vector3(left.x * right, left.y * right, left.z * right); 112 | } 113 | 114 | 115 | //////////////////////////////////////////////////////////// 116 | template 117 | inline Vector3 operator *(T left, const Vector3& right) 118 | { 119 | return Vector3(right.x * left, right.y * left, right.z * left); 120 | } 121 | 122 | 123 | //////////////////////////////////////////////////////////// 124 | template 125 | inline Vector3& operator *=(Vector3& left, T right) 126 | { 127 | left.x *= right; 128 | left.y *= right; 129 | left.z *= right; 130 | 131 | return left; 132 | } 133 | 134 | 135 | //////////////////////////////////////////////////////////// 136 | template 137 | inline Vector3 operator /(const Vector3& left, T right) 138 | { 139 | return Vector3(left.x / right, left.y / right, left.z / right); 140 | } 141 | 142 | 143 | //////////////////////////////////////////////////////////// 144 | template 145 | inline Vector3& operator /=(Vector3& left, T right) 146 | { 147 | left.x /= right; 148 | left.y /= right; 149 | left.z /= right; 150 | 151 | return left; 152 | } 153 | 154 | 155 | //////////////////////////////////////////////////////////// 156 | template 157 | inline bool operator ==(const Vector3& left, const Vector3& right) 158 | { 159 | return (left.x == right.x) && (left.y == right.y) && (left.z == right.z); 160 | } 161 | 162 | 163 | //////////////////////////////////////////////////////////// 164 | template 165 | inline bool operator !=(const Vector3& left, const Vector3& right) 166 | { 167 | return (left.x != right.x) || (left.y != right.y) || (left.z != right.z); 168 | } 169 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Window.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_SFML_WINDOW_HPP 26 | #define SFML_SFML_WINDOW_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | 49 | 50 | #endif // SFML_SFML_WINDOW_HPP 51 | 52 | //////////////////////////////////////////////////////////// 53 | /// \defgroup window Window module 54 | /// 55 | /// Provides OpenGL-based windows, and abstractions for 56 | /// events and input handling. 57 | /// 58 | //////////////////////////////////////////////////////////// 59 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Window/Clipboard.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_CLIPBOARD_HPP 26 | #define SFML_CLIPBOARD_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | //////////////////////////////////////////////////////////// 38 | /// \brief Give access to the system clipboard 39 | /// 40 | //////////////////////////////////////////////////////////// 41 | class SFML_WINDOW_API Clipboard 42 | { 43 | public: 44 | 45 | //////////////////////////////////////////////////////////// 46 | /// \brief Get the content of the clipboard as string data 47 | /// 48 | /// This function returns the content of the clipboard 49 | /// as a string. If the clipboard does not contain string 50 | /// it returns an empty sf::String object. 51 | /// 52 | /// \return Clipboard contents as sf::String object 53 | /// 54 | //////////////////////////////////////////////////////////// 55 | static String getString(); 56 | 57 | //////////////////////////////////////////////////////////// 58 | /// \brief Set the content of the clipboard as string data 59 | /// 60 | /// This function sets the content of the clipboard as a 61 | /// string. 62 | /// 63 | /// \warning Due to limitations on some operating systems, 64 | /// setting the clipboard contents is only 65 | /// guaranteed to work if there is currently an 66 | /// open window for which events are being handled. 67 | /// 68 | /// \param text sf::String containing the data to be sent 69 | /// to the clipboard 70 | /// 71 | //////////////////////////////////////////////////////////// 72 | static void setString(const String& text); 73 | }; 74 | 75 | } // namespace sf 76 | 77 | 78 | #endif // SFML_CLIPBOARD_HPP 79 | 80 | 81 | //////////////////////////////////////////////////////////// 82 | /// \class sf::Clipboard 83 | /// \ingroup window 84 | /// 85 | /// sf::Clipboard provides an interface for getting and 86 | /// setting the contents of the system clipboard. 87 | /// 88 | /// It is important to note that due to limitations on some 89 | /// operating systems, setting the clipboard contents is 90 | /// only guaranteed to work if there is currently an open 91 | /// window for which events are being handled. 92 | /// 93 | /// Usage example: 94 | /// \code 95 | /// // get the clipboard content as a string 96 | /// sf::String string = sf::Clipboard::getString(); 97 | /// 98 | /// // or use it in the event loop 99 | /// sf::Event event; 100 | /// while(window.pollEvent(event)) 101 | /// { 102 | /// if(event.type == sf::Event::Closed) 103 | /// window.close(); 104 | /// if(event.type == sf::Event::KeyPressed) 105 | /// { 106 | /// // Using Ctrl + V to paste a string into SFML 107 | /// if(event.key.control && event.key.code == sf::Keyboard::V) 108 | /// string = sf::Clipboard::getString(); 109 | /// 110 | /// // Using Ctrl + C to copy a string out of SFML 111 | /// if(event.key.control && event.key.code == sf::Keyboard::C) 112 | /// sf::Clipboard::setString("Hello World!"); 113 | /// } 114 | /// } 115 | /// \endcode 116 | /// 117 | /// \see sf::String, sf::Event 118 | /// 119 | //////////////////////////////////////////////////////////// 120 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Window/Export.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_WINDOW_EXPORT_HPP 26 | #define SFML_WINDOW_EXPORT_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | //////////////////////////////////////////////////////////// 35 | // Define portable import / export macros 36 | //////////////////////////////////////////////////////////// 37 | #if defined(SFML_WINDOW_EXPORTS) 38 | 39 | #define SFML_WINDOW_API SFML_API_EXPORT 40 | 41 | #else 42 | 43 | #define SFML_WINDOW_API SFML_API_IMPORT 44 | 45 | #endif 46 | 47 | 48 | #endif // SFML_WINDOW_EXPORT_HPP 49 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Window/GlResource.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_GLRESOURCE_HPP 26 | #define SFML_GLRESOURCE_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | 38 | class Context; 39 | 40 | typedef void(*ContextDestroyCallback)(void*); 41 | 42 | //////////////////////////////////////////////////////////// 43 | /// \brief Base class for classes that require an OpenGL context 44 | /// 45 | //////////////////////////////////////////////////////////// 46 | class SFML_WINDOW_API GlResource 47 | { 48 | protected: 49 | 50 | //////////////////////////////////////////////////////////// 51 | /// \brief Default constructor 52 | /// 53 | //////////////////////////////////////////////////////////// 54 | GlResource(); 55 | 56 | //////////////////////////////////////////////////////////// 57 | /// \brief Destructor 58 | /// 59 | //////////////////////////////////////////////////////////// 60 | ~GlResource(); 61 | 62 | //////////////////////////////////////////////////////////// 63 | /// \brief Register a function to be called when a context is destroyed 64 | /// 65 | /// This is used for internal purposes in order to properly 66 | /// clean up OpenGL resources that cannot be shared between 67 | /// contexts. 68 | /// 69 | /// \param callback Function to be called when a context is destroyed 70 | /// \param arg Argument to pass when calling the function 71 | /// 72 | //////////////////////////////////////////////////////////// 73 | static void registerContextDestroyCallback(ContextDestroyCallback callback, void* arg); 74 | 75 | //////////////////////////////////////////////////////////// 76 | /// \brief RAII helper class to temporarily lock an available context for use 77 | /// 78 | //////////////////////////////////////////////////////////// 79 | class SFML_WINDOW_API TransientContextLock : NonCopyable 80 | { 81 | public: 82 | //////////////////////////////////////////////////////////// 83 | /// \brief Default constructor 84 | /// 85 | //////////////////////////////////////////////////////////// 86 | TransientContextLock(); 87 | 88 | //////////////////////////////////////////////////////////// 89 | /// \brief Destructor 90 | /// 91 | //////////////////////////////////////////////////////////// 92 | ~TransientContextLock(); 93 | }; 94 | }; 95 | 96 | } // namespace sf 97 | 98 | 99 | #endif // SFML_GLRESOURCE_HPP 100 | 101 | //////////////////////////////////////////////////////////// 102 | /// \class sf::GlResource 103 | /// \ingroup window 104 | /// 105 | /// This class is for internal use only, it must be the base 106 | /// of every class that requires a valid OpenGL context in 107 | /// order to work. 108 | /// 109 | //////////////////////////////////////////////////////////// 110 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Window/WindowHandle.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_WINDOWHANDLE_HPP 26 | #define SFML_WINDOWHANDLE_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | // Windows' HWND is a typedef on struct HWND__* 34 | #if defined(SFML_SYSTEM_WINDOWS) 35 | struct HWND__; 36 | #endif 37 | 38 | namespace sf 39 | { 40 | #if defined(SFML_SYSTEM_WINDOWS) 41 | 42 | // Window handle is HWND (HWND__*) on Windows 43 | typedef HWND__* WindowHandle; 44 | 45 | #elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD) || defined(SFML_SYSTEM_OPENBSD) 46 | 47 | // Window handle is Window (unsigned long) on Unix - X11 48 | typedef unsigned long WindowHandle; 49 | 50 | #elif defined(SFML_SYSTEM_MACOS) 51 | 52 | // Window handle is NSWindow or NSView (void*) on Mac OS X - Cocoa 53 | typedef void* WindowHandle; 54 | 55 | #elif defined(SFML_SYSTEM_IOS) 56 | 57 | // Window handle is UIWindow (void*) on iOS - UIKit 58 | typedef void* WindowHandle; 59 | 60 | #elif defined(SFML_SYSTEM_ANDROID) 61 | 62 | // Window handle is ANativeWindow* (void*) on Android 63 | typedef void* WindowHandle; 64 | 65 | #elif defined(SFML_DOXYGEN) 66 | 67 | // Define typedef symbol so that Doxygen can attach some documentation to it 68 | typedef "platform-specific" WindowHandle; 69 | 70 | #endif 71 | 72 | } // namespace sf 73 | 74 | 75 | #endif // SFML_WINDOWHANDLE_HPP 76 | 77 | //////////////////////////////////////////////////////////// 78 | /// \typedef sf::WindowHandle 79 | /// \ingroup window 80 | /// 81 | /// Define a low-level window handle type, specific to 82 | /// each platform. 83 | /// 84 | /// Platform | Type 85 | /// ----------------|------------------------------------------------------------ 86 | /// Windows | \p HWND 87 | /// Linux/FreeBSD | \p %Window 88 | /// Mac OS X | either \p NSWindow* or \p NSView*, disguised as \p void* 89 | /// iOS | \p UIWindow* 90 | /// Android | \p ANativeWindow* 91 | /// 92 | /// \par Mac OS X Specification 93 | /// 94 | /// On Mac OS X, a sf::Window can be created either from an 95 | /// existing \p NSWindow* or an \p NSView*. When the window 96 | /// is created from a window, SFML will use its content view 97 | /// as the OpenGL area. sf::Window::getSystemHandle() will 98 | /// return the handle that was used to create the window, 99 | /// which is a \p NSWindow* by default. 100 | /// 101 | //////////////////////////////////////////////////////////// 102 | -------------------------------------------------------------------------------- /vendor/SFML/include/SFML/Window/WindowStyle.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_WINDOWSTYLE_HPP 26 | #define SFML_WINDOWSTYLE_HPP 27 | 28 | 29 | namespace sf 30 | { 31 | namespace Style 32 | { 33 | //////////////////////////////////////////////////////////// 34 | /// \ingroup window 35 | /// \brief Enumeration of the window styles 36 | /// 37 | //////////////////////////////////////////////////////////// 38 | enum 39 | { 40 | None = 0, ///< No border / title bar (this flag and all others are mutually exclusive) 41 | Titlebar = 1 << 0, ///< Title bar + fixed border 42 | Resize = 1 << 1, ///< Title bar + resizable border + maximize button 43 | Close = 1 << 2, ///< Title bar + close button 44 | Fullscreen = 1 << 3, ///< Fullscreen mode (this flag and all others are mutually exclusive) 45 | 46 | Default = Titlebar | Resize | Close ///< Default window style 47 | }; 48 | } 49 | 50 | } // namespace sf 51 | 52 | 53 | #endif // SFML_WINDOWSTYLE_HPP 54 | -------------------------------------------------------------------------------- /vendor/SFML/lib/win32/sfml-graphics-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win32/sfml-graphics-d.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win32/sfml-graphics.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win32/sfml-graphics.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win32/sfml-main-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win32/sfml-main-d.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win32/sfml-main.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win32/sfml-main.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win32/sfml-system-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win32/sfml-system-d.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win32/sfml-system.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win32/sfml-system.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win32/sfml-window-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win32/sfml-window-d.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win32/sfml-window.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win32/sfml-window.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win64/sfml-graphics-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win64/sfml-graphics-d.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win64/sfml-graphics.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win64/sfml-graphics.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win64/sfml-main-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win64/sfml-main-d.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win64/sfml-main.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win64/sfml-main.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win64/sfml-system-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win64/sfml-system-d.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win64/sfml-system.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win64/sfml-system.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win64/sfml-window-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win64/sfml-window-d.lib -------------------------------------------------------------------------------- /vendor/SFML/lib/win64/sfml-window.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SDraw/driver_kinectV2/5e7f33ac91928dc29d9fc56e9d719dae1b29ec3b/vendor/SFML/lib/win64/sfml-window.lib -------------------------------------------------------------------------------- /vendor/SFML/license.md: -------------------------------------------------------------------------------- 1 | # SFML 2 | 3 | SFML - Copyright (C) 2007-2018 Laurent Gomila - laurent@sfml-dev.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 8 | 9 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 10 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 11 | 3. This notice may not be removed or altered from any source distribution. 12 | 13 | ## External libraries used by SFML 14 | 15 | * _OpenAL-Soft_ is under the LGPL license 16 | * _stb_image_ and _stb_image_write_ are public domain 17 | * _freetype_ is under the FreeType license or the GPL license 18 | * _libogg_ is under the BSD license 19 | * _libvorbis_ is under the BSD license 20 | * _libflac_ is under the BSD license 21 | -------------------------------------------------------------------------------- /vendor/SFML/notice.txt: -------------------------------------------------------------------------------- 1 | This is build fork from (https://github.com/SDraw/SFML/tree/2.5.x) to address SteamVR OpenGL textures problems on AMD GPUs (https://github.com/ValveSoftware/openvr/issues/1246). -------------------------------------------------------------------------------- /vendor/SFML/readme.md: -------------------------------------------------------------------------------- 1 | [![SFML logo](https://www.sfml-dev.org/images/logo.png)](https://www.sfml-dev.org) 2 | 3 | # SFML — Simple and Fast Multimedia Library 4 | 5 | SFML is a simple, fast, cross-platform and object-oriented multimedia API. It provides access to windowing, graphics, audio and network. It is written in C++, and has bindings for various languages such as C, .Net, Ruby, Python. 6 | 7 | ## Authors 8 | 9 | - Laurent Gomila — main developer (laurent@sfml-dev.org) 10 | - Marco Antognini — OS X developer (hiura@sfml-dev.org) 11 | - Jonathan De Wachter — Android developer (dewachter.jonathan@gmail.com) 12 | - Jan Haller (bromeon@sfml-dev.org) 13 | - Stefan Schindler (tank@sfml-dev.org) 14 | - Lukas Dürrenberger (eXpl0it3r@sfml-dev.org) 15 | - binary1248 (binary1248@hotmail.com) 16 | - Artur Moreira (artturmoreira@gmail.com) 17 | - Mario Liebisch (mario@sfml-dev.org) 18 | - And many other members of the SFML community 19 | 20 | ## Download 21 | 22 | You can get the latest official release on [SFML's website](https://www.sfml-dev.org/download.php). You can also get the current development version from the [Git repository](https://github.com/SFML/SFML). 23 | 24 | ## Install 25 | 26 | Follow the instructions of the [tutorials](https://www.sfml-dev.org/tutorials/), there is one for each platform/compiler that SFML supports. 27 | 28 | ## Learn 29 | 30 | There are several places to learn SFML: 31 | 32 | * The [official tutorials](https://www.sfml-dev.org/tutorials/) 33 | * The [online API documentation](https://www.sfml-dev.org/documentation/) 34 | * The [community wiki](https://github.com/SFML/SFML/wiki/) 35 | * The [community forum](https://en.sfml-dev.org/forums/) ([French](https://fr.sfml-dev.org/forums/)) 36 | 37 | ## Contribute 38 | 39 | SFML is an open-source project, and it needs your help to go on growing and improving. If you want to get involved and suggest some additional features, file a bug report or submit a patch, please have a look at the [contribution guidelines](https://www.sfml-dev.org/contribute.php). 40 | --------------------------------------------------------------------------------