├── scrsndcpy ├── scrsndcpy.h ├── Socket.h ├── ProcessIO.h ├── Socket.cpp ├── WavePlay.h ├── resource.h ├── ConfigDlg.cpp ├── ProcessIO.cpp ├── scrsndcpy.rc ├── res │ ├── scrsndcpy.ico │ └── scrsndcpy_.ico ├── stdafx.cpp ├── Utility │ ├── CodeConvert.h │ ├── timer.h │ ├── GdiplusUtil.h │ ├── Logger.h │ ├── CommonUtility.h │ ├── DropHandler.h │ ├── ptreeWrapper.h │ ├── CodeConvert.cpp │ ├── GdiplusUtil.cpp │ ├── WinHTTPWrapper.h │ ├── Logger.cpp │ └── CommonUtility.cpp ├── TesseractWrapper.h ├── cpp.hint ├── Config.h ├── AboutDlg.h ├── scrsndcpy.cpp ├── stdafx.h ├── ConfigDlg.h ├── Config.cpp ├── scrsndcpy.vcxproj.filters └── TesseractWrapper.cpp ├── delayFrame ├── Socket.cpp ├── Socket.h ├── WavePlay.h ├── VolumeControl.h ├── SDL │ ├── SDL_revision.h │ ├── SDL_copying.h │ ├── SDL_opengles2_gl2platform.h │ ├── SDL_types.h │ ├── SDL_name.h │ ├── SDL_opengles.h │ ├── close_code.h │ ├── SDL_opengles2.h │ ├── SDL_test_memory.h │ ├── SDL_test_log.h │ ├── SDL_test.h │ ├── SDL_quit.h │ ├── SDL_test_compare.h │ ├── SDL_test_images.h │ ├── SDL_test_font.h │ ├── SDL_config_minimal.h │ ├── SDL_clipboard.h │ ├── SDL_misc.h │ ├── SDL_power.h │ ├── SDL_metal.h │ ├── SDL_test_random.h │ ├── SDL_test_assert.h │ ├── SDL_config_wiz.h │ ├── SDL_bits.h │ ├── SDL_config_pandora.h │ ├── SDL_gesture.h │ ├── SDL_test_crc32.h │ ├── SDL_locale.h │ ├── SDL_loadso.h │ ├── SDL_config_psp.h │ ├── SDL_touch.h │ ├── SDL_config_android.h │ ├── SDL_config_iphoneos.h │ ├── SDL_test_md5.h │ ├── SDL_test_harness.h │ ├── begin_code.h │ ├── SDL_error.h │ ├── SDL_filesystem.h │ ├── SDL_timer.h │ ├── SDL_shape.h │ ├── SDL_main.h │ ├── SDL_version.h │ └── SDL_config_macosx.h.orig ├── framework.h ├── pch.cpp ├── pch.h ├── SharedMemoryData.h ├── delayFrame.filters ├── stdafx.h └── delayFrame.vcxproj.filters ├── vcpkg.json ├── .gitignore ├── License.txt └── scrsndcpy.sln /scrsndcpy/scrsndcpy.h: -------------------------------------------------------------------------------- 1 | // scrsndcpy.h 2 | -------------------------------------------------------------------------------- /scrsndcpy/Socket.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/scrsndcpy/Socket.h -------------------------------------------------------------------------------- /delayFrame/Socket.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/delayFrame/Socket.cpp -------------------------------------------------------------------------------- /delayFrame/Socket.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/delayFrame/Socket.h -------------------------------------------------------------------------------- /delayFrame/WavePlay.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/delayFrame/WavePlay.h -------------------------------------------------------------------------------- /scrsndcpy/ProcessIO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/scrsndcpy/ProcessIO.h -------------------------------------------------------------------------------- /scrsndcpy/Socket.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/scrsndcpy/Socket.cpp -------------------------------------------------------------------------------- /scrsndcpy/WavePlay.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/scrsndcpy/WavePlay.h -------------------------------------------------------------------------------- /scrsndcpy/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/scrsndcpy/resource.h -------------------------------------------------------------------------------- /scrsndcpy/ConfigDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/scrsndcpy/ConfigDlg.cpp -------------------------------------------------------------------------------- /scrsndcpy/ProcessIO.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/scrsndcpy/ProcessIO.cpp -------------------------------------------------------------------------------- /scrsndcpy/scrsndcpy.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/scrsndcpy/scrsndcpy.rc -------------------------------------------------------------------------------- /delayFrame/VolumeControl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/delayFrame/VolumeControl.h -------------------------------------------------------------------------------- /scrsndcpy/res/scrsndcpy.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/scrsndcpy/res/scrsndcpy.ico -------------------------------------------------------------------------------- /scrsndcpy/res/scrsndcpy_.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amate/scrsndcpy/HEAD/scrsndcpy/res/scrsndcpy_.ico -------------------------------------------------------------------------------- /vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "scrsndcpypackage", 3 | "version-string": "1.0", 4 | "dependencies": [ 5 | "minhook" 6 | ] 7 | } -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "https://github.com/libsdl-org/SDL.git@25f9ed87ff6947d9576fc9d79dee0784e638ac58" 2 | #define SDL_REVISION_NUMBER 0 3 | -------------------------------------------------------------------------------- /delayFrame/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN // Windows ヘッダーからほとんど使用されていない部分を除外する 4 | // Windows ヘッダー ファイル 5 | #include 6 | -------------------------------------------------------------------------------- /delayFrame/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: プリコンパイル済みヘッダーに対応するソース ファイル 2 | 3 | #include "pch.h" 4 | #include "stdafx.h" 5 | 6 | // プリコンパイル済みヘッダーを使用している場合、コンパイルを成功させるにはこのソース ファイルが必要です。 7 | -------------------------------------------------------------------------------- /scrsndcpy/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // scrsndcpy.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | -------------------------------------------------------------------------------- /scrsndcpy/Utility/CodeConvert.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | 6 | namespace CodeConvert 7 | { 8 | std::string ShiftJISfromUTF16(const std::wstring& utf16); 9 | std::wstring UTF16fromShiftJIS(const std::string& sjis); 10 | 11 | std::string UTF8fromUTF16(const std::wstring& utf16); 12 | std::wstring UTF16fromUTF8(const std::string& utf8); 13 | 14 | } // namespace 15 | -------------------------------------------------------------------------------- /delayFrame/pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: プリコンパイル済みヘッダー ファイルです。 2 | // 次のファイルは、その後のビルドのビルド パフォーマンスを向上させるため 1 回だけコンパイルされます。 3 | // コード補完や多くのコード参照機能などの IntelliSense パフォーマンスにも影響します。 4 | // ただし、ここに一覧表示されているファイルは、ビルド間でいずれかが更新されると、すべてが再コンパイルされます。 5 | // 頻繁に更新するファイルをここに追加しないでください。追加すると、パフォーマンス上の利点がなくなります。 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // プリコンパイルするヘッダーをここに追加します 11 | #include "framework.h" 12 | 13 | #endif //PCH_H 14 | -------------------------------------------------------------------------------- /scrsndcpy/TesseractWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | //#include 7 | 8 | 9 | namespace TesseractWrapper { 10 | 11 | bool TesseractInit(); 12 | void TesseractTerm(); 13 | 14 | //using TextFromImageFunc = std::function; 15 | 16 | //std::shared_ptr GetOCRFunction(); 17 | 18 | 19 | std::wstring TextFromImage(const std::wstring& targetImagePath); 20 | 21 | //std::wstring TextFromImageBest(cv::Mat targetImage); 22 | 23 | } // namespace TesseractWrapper 24 | 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #Windowsによって作られるサムネイルを無視 2 | Thumbs.db 3 | #Visual Studioによって作られるファイルを無視 4 | *.obj 5 | *.exe 6 | *.pdb 7 | *.user 8 | *.aps 9 | *.pch 10 | *.vspscc 11 | *_i.c 12 | *_p.c 13 | *.ncb 14 | *.suo 15 | *.tlb 16 | *.tlh 17 | *.bak 18 | *.cache 19 | *.ilk 20 | *.log 21 | [Bb]in 22 | [Dd]ebug*/ 23 | *.sbr 24 | *.opensdf 25 | *.sdf 26 | obj/ 27 | [Rr]elease*/ 28 | _ReSharper*/ 29 | 30 | /enc_temp_folder/ 31 | /#Release/ 32 | /.vs/ 33 | 34 | /vcpkg*/ 35 | /win32-darkmode-master/ 36 | 37 | R[CD]a33180 38 | 39 | 40 | /scrsndcpy/RCa33180 41 | /scrsndcpy/RDa33180 42 | 43 | /x64/ 44 | 45 | -------------------------------------------------------------------------------- /scrsndcpy/cpp.hint: -------------------------------------------------------------------------------- 1 | // ヒント ファイルは、Visual Studio IDE が Visual C++ 識別子を解釈するのに役立ちます 2 | // 関数およびマクロの名前などです。 3 | // 詳細については次を参照してください https://go.microsoft.com/fwlink/?linkid=865984 4 | #define BEGIN_MSG_MAP_EX(theClass) @< 5 | #define END_MSG_MAP() @> 6 | #define BEGIN_DDX_MAP(theClass) @< 7 | #define END_DDX_MAP() @> 8 | #define DECLARE_WND_CLASS_EX(WndClassName, style, bkgnd) static ATL::CWndClassInfo& GetWndClassInfo() { static ATL::CWndClassInfo wc = { { sizeof(WNDCLASSEX), style, StartWindowProc, 0, 0, NULL, NULL, NULL, (HBRUSH)(bkgnd + 1), NULL, WndClassName, NULL }, NULL, NULL, IDC_ARROW, TRUE, 0, _T("") }; return wc; } 9 | -------------------------------------------------------------------------------- /scrsndcpy/Utility/timer.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | namespace Utility { 11 | 12 | class timer : public boost::timer::cpu_timer 13 | { 14 | public: 15 | timer(const std::string& format = "[%ws elapsed]") : m_format(format) 16 | { 17 | start(); 18 | } 19 | 20 | std::string format() { return __super::format(6, m_format); } 21 | std::string format(short places, const std::string& format) { return __super::format(places, format); } 22 | 23 | private: 24 | std::string m_format; 25 | }; 26 | 27 | } // namespace Utility -------------------------------------------------------------------------------- /scrsndcpy/Utility/GdiplusUtil.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file GdiplusUtil.h 3 | * @brief Gdi+を使うのを便利にする 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | // 初期化/後始末 11 | void GdiplusInit(); 12 | void GdiplusTerm(); 13 | 14 | //--------------------------------------- 15 | /// 拡張子を指定してエンコーダーを取得する 16 | Gdiplus::ImageCodecInfo* GetEncoderByExtension(LPCWSTR extension); 17 | 18 | //-------------------------------------- 19 | /// MIMEタイプを指定してエンコーダを取得する 20 | Gdiplus::ImageCodecInfo* GetEncoderByMimeType(LPCWSTR mimetype); 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /delayFrame/SharedMemoryData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | enum CopyDataID { 6 | kPutLog = 1, 7 | }; 8 | 9 | enum DelayFrameCommand { 10 | WM_DELAYFRAME_COMMAND = WM_APP + 3, 11 | kStartSndcpy = 1, 12 | kRestartSndcpy, 13 | kWakefulness, 14 | 15 | kHankakuZenkaku, 16 | kCtrlEnter, 17 | }; 18 | 19 | struct SharedMemoryData 20 | { 21 | uint32_t delayFrameCount; 22 | bool doEventFlag; 23 | 24 | HWND hwndMainDlg; 25 | 26 | bool streamingReady; 27 | bool simpleAudioReady; 28 | int bufferMultiple; 29 | int maxBufferSampleCount; 30 | int playSoundVolume; 31 | bool nowSoundStreaming; 32 | }; 33 | -------------------------------------------------------------------------------- /scrsndcpy/Config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct Config 6 | { 7 | bool autoStart = false; 8 | std::string loginPassword; 9 | bool autoWifiConnect = false; 10 | bool reconnectOnResume = false; 11 | bool enableUHID = false; 12 | bool useScrcpyAudio = true; 13 | 14 | // scrcpy 15 | int maxSize = 0; 16 | int maxFPS = 0; 17 | int bitrate = 0; 18 | bool turnScreenOff = false; 19 | uint32_t delayFrameCount = 0; 20 | uint32_t videoBuffer_ms = 50; 21 | bool noResize = false; 22 | 23 | // sndcpy 24 | int bufferMultiple = 2; 25 | int maxBufferSampleCount = 2000; 26 | bool deviceMuteOnStart = true; 27 | bool toggleMuteReverse = false; 28 | 29 | bool LoadConfig(); 30 | void SaveConfig(); 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /scrsndcpy/Utility/Logger.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #define INFO_LOG BOOST_LOG_SEV(my_logger::get(), boost::log::trivial::info) 14 | #define WARN_LOG BOOST_LOG_SEV(my_logger::get(), boost::log::trivial::warning) 15 | #define ERROR_LOG BOOST_LOG_SEV(my_logger::get(), boost::log::trivial::error) 16 | 17 | //#define SYS_LOGFILE "info.log" 18 | std::string LogFileName(); 19 | 20 | //Narrow-char thread-safe logger. 21 | typedef boost::log::sources::wseverity_logger_mt logger_t; 22 | 23 | //declares a global logger with a custom initialization 24 | BOOST_LOG_GLOBAL_LOGGER(my_logger, logger_t) 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright 2021 amate 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | /*#include */ 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /scrsndcpy/Utility/CommonUtility.h: -------------------------------------------------------------------------------- 1 | 2 | // CommonUtility.h 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace fs = boost::filesystem; 12 | 13 | /// 現在実行中の exeのあるフォルダのパスを返す 14 | fs::path GetExeDirectory(); 15 | 16 | /// 例外を発生させる 17 | #define THROWEXCEPTION(error) FatalErrorOccur(error, __FILE__,__LINE__) 18 | 19 | void FatalErrorOccur(const std::string& error, const char* fileName, const int line); 20 | void FatalErrorOccur(const std::wstring& error, const char* fileName, const int line); 21 | 22 | /// プロセスを起動し、終了まで待つ 23 | DWORD StartProcess(const fs::path& exePath, const std::wstring& commandLine); 24 | 25 | DWORD StartProcessGetStdOut(const fs::path& exePath, const std::wstring& commandLine, std::string& stdoutText); 26 | 27 | fs::path SearchFirstFile(const fs::path& search); 28 | 29 | std::string LoadFile(const fs::path& filePath); 30 | CComPtr LoadFileToMemoryStream(const fs::path& filePath); 31 | 32 | void SaveFile(const fs::path& filePath, const std::string& content); 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDLname_h_ 23 | #define SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /delayFrame/delayFrame.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | ヘッダー ファイル 20 | 21 | 22 | ヘッダー ファイル 23 | 24 | 25 | 26 | 27 | ソース ファイル 28 | 29 | 30 | ソース ファイル 31 | 32 | 33 | -------------------------------------------------------------------------------- /scrsndcpy/Utility/DropHandler.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | ////////////////////////////////////////////////////////////////////// 10 | // DropHandler 11 | ////////////////////////////////////////////////////////////////////// 12 | 13 | class DropHandler 14 | { 15 | private: 16 | HDROP m_hDrop; 17 | UINT m_uCount; 18 | TCHAR m_szFilePath[MAX_PATH + 1]; 19 | 20 | public: 21 | DropHandler(HDROP hDrop) 22 | : m_hDrop(hDrop) 23 | , m_uCount(0) 24 | { 25 | ZeroMemory(m_szFilePath, sizeof(m_szFilePath)); 26 | 27 | if (hDrop) 28 | { 29 | m_uCount = ::DragQueryFile(m_hDrop, 0xFFFFFFFF, NULL, NULL); 30 | } 31 | } 32 | 33 | ~DropHandler() 34 | { 35 | if (m_hDrop) DragFinish(m_hDrop); 36 | } 37 | 38 | HDROP Detach() 39 | { 40 | HDROP h = m_hDrop; 41 | m_hDrop = NULL; 42 | m_uCount = 0; 43 | return h; 44 | } 45 | 46 | UINT GetCount() const 47 | { 48 | return m_uCount; 49 | } 50 | 51 | LPCTSTR operator [] (UINT uIndex) 52 | { 53 | ZeroMemory(m_szFilePath, sizeof(m_szFilePath)); 54 | ::DragQueryFile(m_hDrop, uIndex, m_szFilePath, MAX_PATH); 55 | return m_szFilePath; 56 | } 57 | 58 | LPCTSTR GetFilePath() 59 | { 60 | return operator[](0); 61 | } 62 | 63 | operator HDROP () const 64 | { 65 | return m_hDrop; 66 | } 67 | 68 | BOOL operator ! () const 69 | { 70 | return !m_hDrop; 71 | } 72 | }; 73 | 74 | 75 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifdef __IPHONEOS__ 30 | #include 31 | #include 32 | #else 33 | #include 34 | #include 35 | #endif 36 | 37 | #ifndef APIENTRY 38 | #define APIENTRY 39 | #endif 40 | -------------------------------------------------------------------------------- /scrsndcpy/AboutDlg.h: -------------------------------------------------------------------------------- 1 | // aboutdlg.h : interface of the CAboutDlg class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #pragma once 6 | 7 | #define APP_VERSION L"v1.9" 8 | 9 | class CAboutDlg : public CDialogImpl 10 | { 11 | public: 12 | enum { IDD = IDD_ABOUTBOX }; 13 | 14 | BEGIN_MSG_MAP(CAboutDlg) 15 | MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) 16 | COMMAND_ID_HANDLER(IDOK, OnCloseCmd) 17 | COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd) 18 | END_MSG_MAP() 19 | 20 | // Handler prototypes (uncomment arguments if needed): 21 | // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 22 | // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 23 | // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) 24 | 25 | LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 26 | { 27 | CenterWindow(GetParent()); 28 | 29 | CWindow staticAboutText = GetDlgItem(IDC_STATIC_ABOUT_TEXT); 30 | CString text; 31 | staticAboutText.GetWindowTextW(text.GetBuffer(128), 128); 32 | text.ReleaseBuffer(); 33 | text.Replace(L"%APP_VERSION%", APP_VERSION); 34 | staticAboutText.SetWindowTextW(text); 35 | return TRUE; 36 | } 37 | 38 | LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 39 | { 40 | EndDialog(wID); 41 | return 0; 42 | } 43 | }; 44 | -------------------------------------------------------------------------------- /delayFrame/SDL/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #ifndef _begin_code_h 30 | #error close_code.h included without matching begin_code.h 31 | #endif 32 | #undef _begin_code_h 33 | 34 | /* Reset structure packing at previous byte alignment */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #pragma pack(pop) 40 | #endif /* Compiler needs structure packing set */ 41 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles2.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifndef _MSC_VER 30 | 31 | #ifdef __IPHONEOS__ 32 | #include 33 | #include 34 | #else 35 | #include 36 | #include 37 | #include 38 | #endif 39 | 40 | #else /* _MSC_VER */ 41 | 42 | /* OpenGL ES2 headers for Visual Studio */ 43 | #include "SDL_opengles2_khrplatform.h" 44 | #include "SDL_opengles2_gl2platform.h" 45 | #include "SDL_opengles2_gl2.h" 46 | #include "SDL_opengles2_gl2ext.h" 47 | 48 | #endif /* _MSC_VER */ 49 | 50 | #ifndef APIENTRY 51 | #define APIENTRY GL_APIENTRY 52 | #endif 53 | -------------------------------------------------------------------------------- /scrsndcpy/Utility/ptreeWrapper.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ptreeWrapper.h 3 | */ 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "CommonUtility.h" 15 | 16 | class ptreeWrapper 17 | { 18 | public: 19 | using wptree = boost::property_tree::wptree; 20 | 21 | static wptree LoadIniPtree(const std::string& fileName) 22 | { 23 | wptree pt; 24 | 25 | fs::path filterPath = GetExeDirectory() / fileName; 26 | std::wifstream fs(filterPath); 27 | if (!fs) { 28 | return pt; 29 | } 30 | fs.imbue(std::locale(std::locale(), new std::codecvt_utf8_utf16)); 31 | 32 | try { 33 | boost::property_tree::read_ini(fs, pt); 34 | } 35 | catch (...) { 36 | } 37 | return pt; 38 | } 39 | 40 | static bool SaveIniPtree(const std::string& fileName, const wptree& pt) 41 | { 42 | fs::path filterPath = GetExeDirectory() / fileName; 43 | std::wofstream fs(filterPath); 44 | if (!fs) 45 | return false; 46 | fs.imbue(std::locale(std::locale(), new std::codecvt_utf8_utf16)); 47 | 48 | try { 49 | boost::property_tree::write_ini(fs, pt); 50 | } 51 | catch (...) { 52 | return false; 53 | } 54 | return true; 55 | } 56 | 57 | 58 | static wptree BuildPtreeFromText(const std::wstring& text) 59 | { 60 | std::wstringstream ss(text); 61 | wptree pt; 62 | try { 63 | boost::property_tree::read_xml(ss, pt); 64 | } 65 | catch (...) { 66 | 67 | } 68 | return pt; 69 | } 70 | 71 | }; 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /scrsndcpy/scrsndcpy.cpp: -------------------------------------------------------------------------------- 1 | // scrsndcpy.cpp : main source file for scrsndcpy.exe 2 | // 3 | 4 | #include "stdafx.h" 5 | 6 | #include "MainDlg.h" 7 | #include "Utility\CommonUtility.h" 8 | #include "Utility\GdiplusUtil.h" 9 | #include "Socket.h" 10 | 11 | CAppModule _Module; 12 | HANDLE g_hJob; 13 | 14 | std::string LogFileName() // for Logger 15 | { 16 | auto logPath = GetExeDirectory() / L"info.log"; 17 | return logPath.string(); 18 | } 19 | 20 | void InterlockChildprocessSuicide() 21 | { 22 | g_hJob = ::CreateJobObject(nullptr, nullptr); 23 | ATLASSERT(g_hJob); 24 | JOBOBJECT_EXTENDED_LIMIT_INFORMATION extendedLimit = {}; 25 | extendedLimit.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE; 26 | ::SetInformationJobObject(g_hJob, JobObjectExtendedLimitInformation, &extendedLimit, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION)); 27 | 28 | ::AssignProcessToJobObject(g_hJob, ::GetCurrentProcess()); 29 | } 30 | 31 | int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT) 32 | { 33 | CMessageLoop theLoop; 34 | _Module.AddMessageLoop(&theLoop); 35 | 36 | CMainDlg dlgMain; 37 | 38 | if(dlgMain.Create(NULL) == NULL) 39 | { 40 | ATLTRACE(_T("Main dialog creation failed!\n")); 41 | return 0; 42 | } 43 | 44 | dlgMain.ShowWindow(nCmdShow); 45 | 46 | int nRet = theLoop.Run(); 47 | 48 | _Module.RemoveMessageLoop(); 49 | return nRet; 50 | } 51 | 52 | int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow) 53 | { 54 | HRESULT hRes = ::CoInitialize(NULL); 55 | ATLASSERT(SUCCEEDED(hRes)); 56 | 57 | AtlInitCommonControls(ICC_BAR_CLASSES); // add flags to support other controls 58 | 59 | hRes = _Module.Init(NULL, hInstance); 60 | ATLASSERT(SUCCEEDED(hRes)); 61 | 62 | CSocket::Init(); 63 | GdiplusInit(); 64 | 65 | InterlockChildprocessSuicide(); 66 | 67 | int nRet = Run(lpstrCmdLine, nCmdShow); 68 | 69 | GdiplusTerm(); 70 | CSocket::Term(); 71 | 72 | _Module.Term(); 73 | ::CoUninitialize(); 74 | 75 | return nRet; 76 | } 77 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_memory.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_memory_h_ 31 | #define SDL_test_memory_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | /** 41 | * \brief Start tracking SDL memory allocations 42 | * 43 | * \note This should be called before any other SDL functions for complete tracking coverage 44 | */ 45 | int SDLTest_TrackAllocations(void); 46 | 47 | /** 48 | * \brief Print a log of any outstanding allocations 49 | * 50 | * \note This can be called after SDL_Quit() 51 | */ 52 | void SDLTest_LogAllocations(void); 53 | 54 | 55 | /* Ends C function definitions when using C++ */ 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | #include "close_code.h" 60 | 61 | #endif /* SDL_test_memory_h_ */ 62 | 63 | /* vi: set ts=4 sw=4 expandtab: */ 64 | -------------------------------------------------------------------------------- /scrsndcpy/Utility/CodeConvert.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "stdafx.h" 3 | #include "CodeConvert.h" 4 | #include 5 | 6 | namespace CodeConvert 7 | { 8 | 9 | std::string ShiftJISfromUTF16(const std::wstring & utf16) 10 | { 11 | int requireBytes = ::WideCharToMultiByte(CP_ACP, 0, utf16.c_str(), utf16.length(), nullptr, 0, NULL, NULL); 12 | if (requireBytes > 0) { 13 | std::string sjis; 14 | sjis.resize(requireBytes); 15 | int ret = ::WideCharToMultiByte(CP_ACP, 0, utf16.c_str(), utf16.length(), (LPSTR)sjis.data(), requireBytes, NULL, NULL); 16 | if (ret > 0) { 17 | return sjis; 18 | } 19 | } 20 | return std::string(); 21 | } 22 | 23 | std::wstring UTF16fromShiftJIS(const std::string& sjis) 24 | { 25 | int requireChars = ::MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, sjis.c_str(), sjis.length(), nullptr, 0); 26 | if (requireChars > 0) { 27 | std::wstring utf16; 28 | utf16.resize(requireChars); 29 | int ret = ::MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, sjis.c_str(), sjis.length(), (LPWSTR)utf16.data(), requireChars); 30 | if (ret > 0) { 31 | return utf16; 32 | } 33 | } 34 | return std::wstring(); 35 | } 36 | 37 | std::string UTF8fromUTF16(const std::wstring& utf16) 38 | { 39 | int requireBytes = ::WideCharToMultiByte(CP_UTF8, 0, utf16.c_str(), utf16.length(), nullptr, 0, NULL, NULL); 40 | if (requireBytes > 0) { 41 | std::string utf8; 42 | utf8.resize(requireBytes); 43 | int ret = ::WideCharToMultiByte(CP_UTF8, 0, utf16.c_str(), utf16.length(), (LPSTR)utf8.data(), requireBytes, NULL, NULL); 44 | if (ret > 0) { 45 | return utf8; 46 | } 47 | } 48 | return std::string(); 49 | } 50 | 51 | std::wstring UTF16fromUTF8(const std::string& utf8) 52 | { 53 | int requireChars = ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8.c_str(), utf8.length(), nullptr, 0); 54 | if (requireChars > 0) { 55 | std::wstring utf16; 56 | utf16.resize(requireChars); 57 | int ret = ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8.c_str(), utf8.length(), (LPWSTR)utf16.data(), requireChars); 58 | if (ret > 0) { 59 | return utf16; 60 | } 61 | } 62 | return std::wstring(); 63 | } 64 | 65 | 66 | 67 | 68 | 69 | 70 | } // namespace CodeConvert -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_test_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_log.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | * 32 | * Wrapper to log in the TEST category 33 | * 34 | */ 35 | 36 | #ifndef SDL_test_log_h_ 37 | #define SDL_test_log_h_ 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority. 47 | * 48 | * \param fmt Message to be logged 49 | */ 50 | void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 51 | 52 | /** 53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. 54 | * 55 | * \param fmt Message to be logged 56 | */ 57 | void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 58 | 59 | /* Ends C function definitions when using C++ */ 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #include "close_code.h" 64 | 65 | #endif /* SDL_test_log_h_ */ 66 | 67 | /* vi: set ts=4 sw=4 expandtab: */ 68 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_h_ 31 | #define SDL_test_h_ 32 | 33 | #include "SDL.h" 34 | #include "SDL_test_assert.h" 35 | #include "SDL_test_common.h" 36 | #include "SDL_test_compare.h" 37 | #include "SDL_test_crc32.h" 38 | #include "SDL_test_font.h" 39 | #include "SDL_test_fuzzer.h" 40 | #include "SDL_test_harness.h" 41 | #include "SDL_test_images.h" 42 | #include "SDL_test_log.h" 43 | #include "SDL_test_md5.h" 44 | #include "SDL_test_memory.h" 45 | #include "SDL_test_random.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /* Global definitions */ 54 | 55 | /* 56 | * Note: Maximum size of SDLTest log message is less than SDL's limit 57 | * to ensure we can fit additional information such as the timestamp. 58 | */ 59 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /scrsndcpy.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31229.75 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scrsndcpy", "scrsndcpy\scrsndcpy.vcxproj", "{AA5C36B1-AAF9-4A85-ABA7-578B7132AF93}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "delayFrame", "delayFrame\delayFrame.vcxproj", "{E2F549A7-7739-4624-ACF4-E50FF72934C1}" 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 | {AA5C36B1-AAF9-4A85-ABA7-578B7132AF93}.Debug|x64.ActiveCfg = Debug|x64 19 | {AA5C36B1-AAF9-4A85-ABA7-578B7132AF93}.Debug|x64.Build.0 = Debug|x64 20 | {AA5C36B1-AAF9-4A85-ABA7-578B7132AF93}.Debug|x86.ActiveCfg = Debug|Win32 21 | {AA5C36B1-AAF9-4A85-ABA7-578B7132AF93}.Debug|x86.Build.0 = Debug|Win32 22 | {AA5C36B1-AAF9-4A85-ABA7-578B7132AF93}.Release|x64.ActiveCfg = Release|x64 23 | {AA5C36B1-AAF9-4A85-ABA7-578B7132AF93}.Release|x64.Build.0 = Release|x64 24 | {AA5C36B1-AAF9-4A85-ABA7-578B7132AF93}.Release|x86.ActiveCfg = Release|Win32 25 | {AA5C36B1-AAF9-4A85-ABA7-578B7132AF93}.Release|x86.Build.0 = Release|Win32 26 | {E2F549A7-7739-4624-ACF4-E50FF72934C1}.Debug|x64.ActiveCfg = Debug|x64 27 | {E2F549A7-7739-4624-ACF4-E50FF72934C1}.Debug|x64.Build.0 = Debug|x64 28 | {E2F549A7-7739-4624-ACF4-E50FF72934C1}.Debug|x86.ActiveCfg = Debug|Win32 29 | {E2F549A7-7739-4624-ACF4-E50FF72934C1}.Debug|x86.Build.0 = Debug|Win32 30 | {E2F549A7-7739-4624-ACF4-E50FF72934C1}.Release|x64.ActiveCfg = Release|x64 31 | {E2F549A7-7739-4624-ACF4-E50FF72934C1}.Release|x64.Build.0 = Release|x64 32 | {E2F549A7-7739-4624-ACF4-E50FF72934C1}.Release|x86.ActiveCfg = Release|Win32 33 | {E2F549A7-7739-4624-ACF4-E50FF72934C1}.Release|x86.Build.0 = Release|Win32 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | GlobalSection(ExtensibilityGlobals) = postSolution 39 | SolutionGuid = {DC35BEF1-A7CA-4272-B5CF-7EABACD5E691} 40 | EndGlobalSection 41 | EndGlobal 42 | -------------------------------------------------------------------------------- /scrsndcpy/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | // Change these values to use different versions 9 | //#define WINVER 0x0601 10 | //#define _WIN32_WINNT 0x0601 11 | //#define _WIN32_IE 0x0700 12 | #define _RICHEDIT_VER 0x0500 13 | 14 | #include 15 | #include 16 | 17 | extern CAppModule _Module; 18 | 19 | #include 20 | #include 21 | 22 | #if defined _M_IX86 23 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") 24 | #elif defined _M_IA64 25 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") 26 | #elif defined _M_X64 27 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") 28 | #else 29 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 30 | #endif 31 | 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include // is_any_of 56 | #include 57 | 58 | #include "Utility\json.hpp" 59 | #include "Utility\GdiplusUtil.h" 60 | #include "Utility\CommonUtility.h" 61 | #include "Utility\CodeConvert.h" 62 | #include "Utility\Logger.h" 63 | #include "Utility\timer.h" 64 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_quit.h 24 | * 25 | * Include file for SDL quit event handling. 26 | */ 27 | 28 | #ifndef SDL_quit_h_ 29 | #define SDL_quit_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | /** 35 | * \file SDL_quit.h 36 | * 37 | * An ::SDL_QUIT event is generated when the user tries to close the application 38 | * window. If it is ignored or filtered out, the window will remain open. 39 | * If it is not ignored or filtered, it is queued normally and the window 40 | * is allowed to close. When the window is closed, screen updates will 41 | * complete, but have no effect. 42 | * 43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 44 | * and SIGTERM (system termination request), if handlers do not already 45 | * exist, that generate ::SDL_QUIT events as well. There is no way 46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal 47 | * handler in your application will override the default generation of 48 | * quit events for that signal. 49 | * 50 | * \sa SDL_Quit() 51 | */ 52 | 53 | /* There are no functions directly affecting the quit event */ 54 | 55 | #define SDL_QuitRequested() \ 56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) 57 | 58 | #endif /* SDL_quit_h_ */ 59 | -------------------------------------------------------------------------------- /delayFrame/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | // Change these values to use different versions 9 | //#define WINVER 0x0601 10 | //#define _WIN32_WINNT 0x0601 11 | //#define _WIN32_IE 0x0700 12 | #define _RICHEDIT_VER 0x0500 13 | 14 | #define _WINSOCK_DEPRECATED_NO_WARNINGS 15 | 16 | #include 17 | #include 18 | 19 | extern CAppModule _Module; 20 | 21 | #include 22 | #include 23 | 24 | #if defined _M_IX86 25 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") 26 | #elif defined _M_IA64 27 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") 28 | #elif defined _M_X64 29 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") 30 | #else 31 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 32 | #endif 33 | 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include // is_any_of 58 | #include 59 | 60 | #if 0 61 | #include "Utility\json.hpp" 62 | #include "Utility\GdiplusUtil.h" 63 | #include "Utility\CommonUtility.h" 64 | #include "Utility\CodeConvert.h" 65 | #include "Utility\Logger.h" 66 | #include "Utility\timer.h" 67 | #endif 68 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_test_compare.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_compare.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines comparison functions (i.e. for surfaces). 33 | 34 | */ 35 | 36 | #ifndef SDL_test_compare_h_ 37 | #define SDL_test_compare_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "SDL_test_images.h" 42 | 43 | #include "begin_code.h" 44 | /* Set up for C function definitions, even when using C++ */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * \brief Compares a surface and with reference image data for equality 51 | * 52 | * \param surface Surface used in comparison 53 | * \param referenceSurface Test Surface used in comparison 54 | * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. 55 | * 56 | * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. 57 | */ 58 | int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); 59 | 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_compare_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /scrsndcpy/Utility/GdiplusUtil.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file GdiplusUtil.cpp 3 | * @brief Gdi+を使うのを便利にする 4 | */ 5 | 6 | #include "stdafx.h" 7 | #include "GdiplusUtil.h" 8 | 9 | #pragma comment(lib, "gdiplus.lib") 10 | 11 | using namespace Gdiplus; 12 | 13 | 14 | namespace { 15 | 16 | class CGdlplusUtil 17 | { 18 | public: 19 | CGdlplusUtil() 20 | : m_token(0) 21 | , m_nEncoders(0) 22 | , m_pImageCodecInfo(NULL) 23 | { } 24 | 25 | void Init() 26 | { 27 | GdiplusStartupInput gdiplusStartupInput; 28 | GdiplusStartup(&m_token, &gdiplusStartupInput, NULL); 29 | 30 | UINT size; 31 | GetImageEncodersSize(&m_nEncoders, &size); 32 | m_pImageCodecInfo = (Gdiplus::ImageCodecInfo*)(malloc(size)); 33 | GetImageEncoders(m_nEncoders, size, m_pImageCodecInfo); 34 | } 35 | void Term() 36 | { 37 | if (m_pImageCodecInfo) { 38 | free(m_pImageCodecInfo); 39 | m_pImageCodecInfo = nullptr; 40 | Gdiplus::GdiplusShutdown(m_token); 41 | m_token = 0; 42 | } 43 | } 44 | 45 | ImageCodecInfo* GetEncoderByExtension(LPCWSTR extension) 46 | { 47 | for (UINT i = 0; i < m_nEncoders; ++i) { 48 | if (PathMatchSpecW(extension, m_pImageCodecInfo[i].FilenameExtension)) 49 | return &m_pImageCodecInfo[i]; 50 | } 51 | return nullptr; 52 | } 53 | 54 | ImageCodecInfo* GetEncoderByMimeType(LPCWSTR mimetype) 55 | { 56 | for (UINT i = 0; i < m_nEncoders; ++i) { 57 | if (wcscmp(m_pImageCodecInfo[i].MimeType, mimetype) == 0) 58 | return &m_pImageCodecInfo[i]; 59 | } 60 | return nullptr; 61 | } 62 | 63 | private: 64 | ULONG_PTR m_token; 65 | UINT m_nEncoders; 66 | ImageCodecInfo* m_pImageCodecInfo; 67 | 68 | 69 | }; 70 | 71 | CGdlplusUtil GdiplusUtil; 72 | 73 | }; // namespace 74 | 75 | 76 | void GdiplusInit() 77 | { 78 | GdiplusUtil.Init(); 79 | } 80 | 81 | void GdiplusTerm() 82 | { 83 | GdiplusUtil.Term(); 84 | } 85 | 86 | 87 | 88 | 89 | //--------------------------------------- 90 | /// 拡張子を指定してエンコーダーを取得する 91 | Gdiplus::ImageCodecInfo* GetEncoderByExtension(LPCWSTR extension) 92 | { 93 | return GdiplusUtil.GetEncoderByExtension(extension); 94 | } 95 | 96 | 97 | //-------------------------------------- 98 | /// MIMEタイプを指定してエンコーダを取得する 99 | Gdiplus::ImageCodecInfo* GetEncoderByMimeType(LPCWSTR mimetype) 100 | { 101 | return GdiplusUtil.GetEncoderByMimeType(mimetype); 102 | } 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /delayFrame/delayFrame.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | Source Files 9 | 10 | 11 | Source Files 12 | 13 | 14 | Source Files 15 | 16 | 17 | Source Files\Utility 18 | 19 | 20 | Source Files\Utility 21 | 22 | 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files\SDL 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files\Utility 47 | 48 | 49 | Source Files\Utility 50 | 51 | 52 | Source Files 53 | 54 | 55 | 56 | 57 | {4aa93666-da24-4511-a178-484436aa4c6a} 58 | 59 | 60 | {cdf18915-9971-4e2e-890d-969050dae08c} 61 | 62 | 63 | {b5b0bee3-fc31-4927-8fdd-c50e38c79359} 64 | 65 | 66 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_test_images.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_images.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines some images for tests. 33 | 34 | */ 35 | 36 | #ifndef SDL_test_images_h_ 37 | #define SDL_test_images_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "begin_code.h" 42 | /* Set up for C function definitions, even when using C++ */ 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /** 48 | *Type for test images. 49 | */ 50 | typedef struct SDLTest_SurfaceImage_s { 51 | int width; 52 | int height; 53 | unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ 54 | const char *pixel_data; 55 | } SDLTest_SurfaceImage_t; 56 | 57 | /* Test images */ 58 | SDL_Surface *SDLTest_ImageBlit(void); 59 | SDL_Surface *SDLTest_ImageBlitColor(void); 60 | SDL_Surface *SDLTest_ImageBlitAlpha(void); 61 | SDL_Surface *SDLTest_ImageBlitBlendAdd(void); 62 | SDL_Surface *SDLTest_ImageBlitBlend(void); 63 | SDL_Surface *SDLTest_ImageBlitBlendMod(void); 64 | SDL_Surface *SDLTest_ImageBlitBlendNone(void); 65 | SDL_Surface *SDLTest_ImageBlitBlendAll(void); 66 | SDL_Surface *SDLTest_ImageFace(void); 67 | SDL_Surface *SDLTest_ImagePrimitives(void); 68 | SDL_Surface *SDLTest_ImagePrimitivesBlend(void); 69 | 70 | /* Ends C function definitions when using C++ */ 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | #include "close_code.h" 75 | 76 | #endif /* SDL_test_images_h_ */ 77 | 78 | /* vi: set ts=4 sw=4 expandtab: */ 79 | -------------------------------------------------------------------------------- /scrsndcpy/ConfigDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Config.h" 4 | //#include "DarkModeUI.h" 5 | #include "resource.h" 6 | 7 | 8 | class ConfigDlg : 9 | public CDialogImpl, 10 | public CWinDataExchange 11 | // public DarkModeUI 12 | { 13 | public: 14 | enum { IDD = IDD_CONFIG }; 15 | 16 | ConfigDlg(Config& config); 17 | 18 | BEGIN_DDX_MAP(ConfigDlg) 19 | DDX_CHECK(IDC_CHECK_AUTO_START, m_tempConfig.autoStart) 20 | DDX_TEXT(IDC_EDIT_LOGIN_PASSWORD, m_loginPassword) 21 | DDX_CHECK(IDC_CHECK_AUTO_WIFI_CONNECT, m_tempConfig.autoWifiConnect) 22 | DDX_CHECK(IDC_CHECK_RECONNECT_ON_RESUME, m_tempConfig.reconnectOnResume) 23 | DDX_CHECK(IDC_CHECK_ENABLE_UHID, m_tempConfig.enableUHID) 24 | DDX_RADIO(IDC_RADIO_AUDIO_SCRCPY, m_radioAudioScrcpy) 25 | 26 | DDX_INT_RANGE(IDC_EDIT_MAX_SIZE, m_tempConfig.maxSize, 0, 10000) 27 | DDX_INT_RANGE(IDC_EDIT_MAX_FPS, m_tempConfig.maxFPS, 0, 120) 28 | DDX_INT_RANGE(IDC_EDIT_BIT_RATE, m_tempConfig.bitrate, 0, 50) 29 | DDX_INT_RANGE(IDC_EDIT_DELAY_FRAME_COUNT, m_tempConfig.delayFrameCount, 0u, 100u) 30 | DDX_INT_RANGE(IDC_EDIT_VIDEO_BUFFER_MS, m_tempConfig.videoBuffer_ms, 0u, 1000u) 31 | DDX_CHECK(IDC_CHECK_TURN_SCREEN_OFF, m_tempConfig.turnScreenOff) 32 | DDX_CHECK(IDC_CHECK_NO_RESIZE, m_tempConfig.noResize) 33 | 34 | DDX_INT_RANGE(IDC_EDIT_BUFFER_MULTIPLE, m_tempConfig.bufferMultiple, 1, 10) 35 | DDX_INT_RANGE(IDC_EDIT_MAXBUFFERSAMPLECOUNT,m_tempConfig.maxBufferSampleCount, 0, 48000) 36 | DDX_CHECK(IDC_CHECK_DEVICE_MUTE_ON_START, m_tempConfig.deviceMuteOnStart) 37 | DDX_CHECK(IDC_CHECK_TOGGLE_MUTE_REVERSE, m_tempConfig.toggleMuteReverse) 38 | END_DDX_MAP() 39 | 40 | BEGIN_MSG_MAP_EX(ConfigDlg) 41 | MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) 42 | COMMAND_ID_HANDLER(IDOK, OnOK) 43 | COMMAND_ID_HANDLER(IDCANCEL, OnCancel) 44 | 45 | END_MSG_MAP() 46 | 47 | // Handler prototypes (uncomment arguments if needed): 48 | // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 49 | // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 50 | // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) 51 | 52 | LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); 53 | LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 54 | LRESULT OnCancel(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 55 | 56 | 57 | private: 58 | Config& m_config; 59 | 60 | CString m_loginPassword; 61 | Config m_tempConfig; 62 | int m_radioAudioScrcpy; 63 | 64 | }; 65 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_test_font.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_font.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_font_h_ 31 | #define SDL_test_font_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | #define FONT_CHARACTER_SIZE 8 42 | 43 | /** 44 | * \brief Draw a string in the currently set font. 45 | * 46 | * \param renderer The renderer to draw on. 47 | * \param x The X coordinate of the upper left corner of the character. 48 | * \param y The Y coordinate of the upper left corner of the character. 49 | * \param c The character to draw. 50 | * 51 | * \returns 0 on success, -1 on failure. 52 | */ 53 | int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c); 54 | 55 | /** 56 | * \brief Draw a string in the currently set font. 57 | * 58 | * \param renderer The renderer to draw on. 59 | * \param x The X coordinate of the upper left corner of the string. 60 | * \param y The Y coordinate of the upper left corner of the string. 61 | * \param s The string to draw. 62 | * 63 | * \returns 0 on success, -1 on failure. 64 | */ 65 | int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s); 66 | 67 | 68 | /** 69 | * \brief Cleanup textures used by font drawing functions. 70 | */ 71 | void SDLTest_CleanupTextDrawing(void); 72 | 73 | /* Ends C function definitions when using C++ */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | #include "close_code.h" 78 | 79 | #endif /* SDL_test_font_h_ */ 80 | 81 | /* vi: set ts=4 sw=4 expandtab: */ 82 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_config_minimal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_minimal_h_ 23 | #define SDL_config_minimal_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | /** 29 | * \file SDL_config_minimal.h 30 | * 31 | * This is the minimal configuration that can be used to build SDL. 32 | */ 33 | 34 | #define HAVE_STDARG_H 1 35 | #define HAVE_STDDEF_H 1 36 | 37 | /* Most everything except Visual Studio 2008 and earlier has stdint.h now */ 38 | #if defined(_MSC_VER) && (_MSC_VER < 1600) 39 | /* Here are some reasonable defaults */ 40 | typedef unsigned int size_t; 41 | typedef signed char int8_t; 42 | typedef unsigned char uint8_t; 43 | typedef signed short int16_t; 44 | typedef unsigned short uint16_t; 45 | typedef signed int int32_t; 46 | typedef unsigned int uint32_t; 47 | typedef signed long long int64_t; 48 | typedef unsigned long long uint64_t; 49 | typedef unsigned long uintptr_t; 50 | #else 51 | #define HAVE_STDINT_H 1 52 | #endif /* Visual Studio 2008 */ 53 | 54 | #ifdef __GNUC__ 55 | #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 56 | #endif 57 | 58 | /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ 59 | #define SDL_AUDIO_DRIVER_DUMMY 1 60 | 61 | /* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ 62 | #define SDL_JOYSTICK_DISABLED 1 63 | 64 | /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ 65 | #define SDL_HAPTIC_DISABLED 1 66 | 67 | /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ 68 | #define SDL_LOADSO_DISABLED 1 69 | 70 | /* Enable the stub thread support (src/thread/generic/\*.c) */ 71 | #define SDL_THREADS_DISABLED 1 72 | 73 | /* Enable the stub timer support (src/timer/dummy/\*.c) */ 74 | #define SDL_TIMERS_DISABLED 1 75 | 76 | /* Enable the dummy video driver (src/video/dummy/\*.c) */ 77 | #define SDL_VIDEO_DRIVER_DUMMY 1 78 | 79 | /* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ 80 | #define SDL_FILESYSTEM_DUMMY 1 81 | 82 | #endif /* SDL_config_minimal_h_ */ 83 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_clipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_clipboard.h 24 | * 25 | * Include file for SDL clipboard handling 26 | */ 27 | 28 | #ifndef SDL_clipboard_h_ 29 | #define SDL_clipboard_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | /** 42 | * Put UTF-8 text into the clipboard. 43 | * 44 | * \param text the text to store in the clipboard 45 | * \returns 0 on success or a negative error code on failure; call 46 | * SDL_GetError() for more information. 47 | * 48 | * \sa SDL_GetClipboardText 49 | * \sa SDL_HasClipboardText 50 | */ 51 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); 52 | 53 | /** 54 | * Get UTF-8 text from the clipboard, which must be freed with SDL_free(). 55 | * 56 | * This functions returns NULL if there was not enough memory left for a copy 57 | * of the clipboard's content. 58 | * 59 | * \returns the clipboard text on success or NULL on failure; call 60 | * SDL_GetError() for more information. Caller must call SDL_free() 61 | * on the returned pointer when done with it. 62 | * 63 | * \sa SDL_HasClipboardText 64 | * \sa SDL_SetClipboardText 65 | */ 66 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); 67 | 68 | /** 69 | * Query whether the clipboard exists and contains a non-empty text string. 70 | * 71 | * \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not. 72 | * 73 | * \since This function is available since SDL 2.0.0. 74 | * 75 | * \sa SDL_GetClipboardText 76 | * \sa SDL_SetClipboardText 77 | */ 78 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); 79 | 80 | 81 | /* Ends C function definitions when using C++ */ 82 | #ifdef __cplusplus 83 | } 84 | #endif 85 | #include "close_code.h" 86 | 87 | #endif /* SDL_clipboard_h_ */ 88 | 89 | /* vi: set ts=4 sw=4 expandtab: */ 90 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_misc.h 24 | * 25 | * \brief Include file for SDL API functions that don't fit elsewhere. 26 | */ 27 | 28 | #ifndef SDL_misc_h_ 29 | #define SDL_misc_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * Open a URL/URI in the browser or other appropriate external application. 42 | * 43 | * Open a URL in a separate, system-provided application. How this works will 44 | * vary wildly depending on the platform. This will likely launch what makes 45 | * sense to handle a specific URL's protocol (a web browser for `http://`, 46 | * etc), but it might also be able to launch file managers for directories and 47 | * other things. 48 | * 49 | * What happens when you open a URL varies wildly as well: your game window 50 | * may lose focus (and may or may not lose focus if your game was fullscreen 51 | * or grabbing input at the time). On mobile devices, your app will likely 52 | * move to the background or your process might be paused. Any given platform 53 | * may or may not handle a given URL. 54 | * 55 | * If this is unimplemented (or simply unavailable) for a platform, this will 56 | * fail with an error. A successful result does not mean the URL loaded, just 57 | * that we launched _something_ to handle it (or at least believe we did). 58 | * 59 | * All this to say: this function can be useful, but you should definitely 60 | * test it on every platform you target. 61 | * 62 | * \param url A valid URL/URI to open. Use `file:///full/path/to/file` for 63 | * local files, if supported. 64 | * \returns 0 on success, or -1 on error; call SDL_GetError() for more 65 | * information. 66 | * 67 | * \since This function is available in SDL 2.0.14 and newer 68 | */ 69 | extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url); 70 | 71 | /* Ends C function definitions when using C++ */ 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | #include "close_code.h" 76 | 77 | #endif /* SDL_misc_h_ */ 78 | 79 | /* vi: set ts=4 sw=4 expandtab: */ 80 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_power.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_power_h_ 23 | #define SDL_power_h_ 24 | 25 | /** 26 | * \file SDL_power.h 27 | * 28 | * Header for the SDL power management routines. 29 | */ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * The basic state for the system's power supply. 41 | */ 42 | typedef enum 43 | { 44 | SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ 45 | SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ 46 | SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ 47 | SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ 48 | SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ 49 | } SDL_PowerState; 50 | 51 | 52 | /** 53 | * Get the current power supply details. 54 | * 55 | * You should never take a battery status as absolute truth. Batteries 56 | * (especially failing batteries) are delicate hardware, and the values 57 | * reported here are best estimates based on what that hardware reports. It's 58 | * not uncommon for older batteries to lose stored power much faster than it 59 | * reports, or completely drain when reporting it has 20 percent left, etc. 60 | * 61 | * Battery status can change at any time; if you are concerned with power 62 | * state, you should call this function frequently, and perhaps ignore changes 63 | * until they seem to be stable for a few seconds. 64 | * 65 | * It's possible a platform can only report battery percentage or time left 66 | * but not both. 67 | * 68 | * \param secs seconds of battery life left, you can pass a NULL here if you 69 | * don't care, will return -1 if we can't determine a value, or 70 | * we're not running on a battery 71 | * \param pct percentage of battery life left, between 0 and 100, you can pass 72 | * a NULL here if you don't care, will return -1 if we can't 73 | * determine a value, or we're not running on a battery 74 | * \returns an SDL_PowerState enum representing the current battery state. 75 | */ 76 | extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); 77 | 78 | /* Ends C function definitions when using C++ */ 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #include "close_code.h" 83 | 84 | #endif /* SDL_power_h_ */ 85 | 86 | /* vi: set ts=4 sw=4 expandtab: */ 87 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_metal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_metal.h 24 | * 25 | * Header file for functions to creating Metal layers and views on SDL windows. 26 | */ 27 | 28 | #ifndef SDL_metal_h_ 29 | #define SDL_metal_h_ 30 | 31 | #include "SDL_video.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). 41 | * 42 | * \note This can be cast directly to an NSView or UIView. 43 | */ 44 | typedef void *SDL_MetalView; 45 | 46 | /** 47 | * \name Metal support functions 48 | */ 49 | /* @{ */ 50 | 51 | /** 52 | * Create a CAMetalLayer-backed NSView/UIView and attach it to the specified 53 | * window. 54 | * 55 | * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on 56 | * its own. It is up to user code to do that. 57 | * 58 | * The returned handle can be casted directly to a NSView or UIView. To access 59 | * the backing CAMetalLayer, call SDL_Metal_GetLayer(). 60 | * 61 | * \sa SDL_Metal_DestroyView 62 | * \sa SDL_Metal_GetLayer 63 | */ 64 | extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); 65 | 66 | /** 67 | * Destroy an existing SDL_MetalView object. 68 | * 69 | * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was 70 | * called after SDL_CreateWindow. 71 | * 72 | * \sa SDL_Metal_CreateView 73 | */ 74 | extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); 75 | 76 | /** 77 | * Get a pointer to the backing CAMetalLayer for the given view. 78 | * 79 | * \sa SDL_MetalCreateView 80 | */ 81 | extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); 82 | 83 | /** 84 | * Get the size of a window's underlying drawable in pixels (for use with 85 | * setting viewport, scissor & etc). 86 | * 87 | * \param window SDL_Window from which the drawable size should be queried 88 | * \param w Pointer to variable for storing the width in pixels, may be NULL 89 | * 90 | * \sa SDL_GetWindowSize 91 | * \sa SDL_CreateWindow 92 | */ 93 | extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w, 94 | int *h); 95 | 96 | /* @} *//* Metal support functions */ 97 | 98 | /* Ends C function definitions when using C++ */ 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | #include "close_code.h" 103 | 104 | #endif /* SDL_metal_h_ */ 105 | -------------------------------------------------------------------------------- /scrsndcpy/Utility/WinHTTPWrapper.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace WinHTTPWrapper { 10 | 11 | bool InitWinHTTP(boost::optional optUserAgent = boost::none, boost::optional optProxy = boost::none); 12 | void TermWinHTTP(); 13 | 14 | struct HINTERNET_deleter 15 | { 16 | typedef HINTERNET pointer; 17 | void operator () (HINTERNET handle) { 18 | ATLVERIFY(::WinHttpCloseHandle(handle)); 19 | } 20 | }; 21 | 22 | typedef std::unique_ptr INetHandle; 23 | 24 | 25 | typedef boost::error_info ex_add_info; 26 | 27 | struct WinHTTPException : virtual boost::exception, virtual std::exception 28 | { 29 | WinHTTPException() 30 | { 31 | dwGetLastError = ::GetLastError(); 32 | *this << ex_add_info(dwGetLastError); 33 | } 34 | 35 | DWORD dwGetLastError; 36 | }; 37 | 38 | class CUrl 39 | { 40 | public: 41 | CUrl() { } 42 | 43 | CUrl(const CString& url) : m_url(url) 44 | { 45 | Set(url); 46 | } 47 | 48 | CUrl(const std::wstring& url) : m_url(url.c_str()) 49 | { 50 | Set(url.c_str()); 51 | } 52 | 53 | void Set(const CString& url) 54 | { 55 | URL_COMPONENTS urlComp = { sizeof(URL_COMPONENTS) }; 56 | urlComp.dwHostNameLength = -1; 57 | urlComp.dwUrlPathLength = -1; 58 | if (::WinHttpCrackUrl(url, url.GetLength(), 0, &urlComp) == FALSE) 59 | BOOST_THROW_EXCEPTION(WinHTTPException()); 60 | m_hostName = CString(urlComp.lpszHostName, urlComp.dwHostNameLength); 61 | m_path = CString(urlComp.lpszUrlPath, urlComp.dwUrlPathLength); 62 | if (urlComp.nScheme == INTERNET_SCHEME_HTTPS) 63 | m_optSSLPort = urlComp.nPort; 64 | } 65 | 66 | const CString& GetURL() const { return m_url; } 67 | const CString& GetHost() const { return m_hostName; } 68 | const CString& GetPath() const { return m_path; } 69 | boost::optional GetSSLPortNumber() const { return m_optSSLPort; } 70 | 71 | private: 72 | CString m_url; 73 | CString m_hostName; 74 | CString m_path; 75 | boost::optional m_optSSLPort; 76 | }; 77 | 78 | /// urlで指定したサーバーとのコネクションを作成する 79 | INetHandle HttpConnect(const CUrl& url); 80 | 81 | /// コネクションから実際のリソースに対するリクエストを作成する 82 | INetHandle HttpOpenRequest(const CUrl& url, const INetHandle& hConnect, LPCWSTR Verb = L"GET", const CString& referer = CString()); 83 | 84 | /// リクエストヘッダを追加する 85 | void HttpAddRequestHeaders(const INetHandle& hRequest, const CString& addHeaders, DWORD dwModifiers = WINHTTP_ADDREQ_FLAG_ADD); 86 | 87 | /// リクエストの設定を変更する 88 | void HttpSetOption(const INetHandle& hRequest, DWORD option, DWORD optionValue); 89 | 90 | /// リクエストにプロクシを設定する 91 | void HttpSetProxy(const INetHandle& hRequest, const CString& proxy); 92 | 93 | /// リクエストを送信した後、応答があるまで待つ 94 | bool HttpSendRequestAndReceiveResponse(const INetHandle& hRequest, const std::string& postData = std::string()); 95 | 96 | /// リクエスト結果のステータスコードを返す 97 | DWORD HttpQueryStatusCode(const INetHandle& hRequest); 98 | 99 | /// InfoLevelで指定したレスポンスヘッダを返す 100 | bool HttpQueryHeaders(const INetHandle& hRequest, DWORD InfoLevel, CString& headerContents); 101 | 102 | /// InfoLevelで指定したレスポンスヘッダを返す 103 | bool HttpQueryHeaders(const INetHandle& hRequest, DWORD InfoLevel, DWORD& headerContents); 104 | 105 | // レスポンスヘッダを生のまま返す 106 | bool HttpQueryRawHeaders(const INetHandle& hRequest, CString& rawHeaderContents); 107 | 108 | /// レスポンスからボディ部分を取得する 109 | std::string HttpReadData(const INetHandle& hRequest); 110 | 111 | /// urlからダウンロードする 112 | boost::optional HttpDownloadData(const CString& url); 113 | 114 | 115 | } // namespace WinHTTPWrapper -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_test_random.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_random.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | A "32-bit Multiply with carry random number generator. Very fast. 33 | Includes a list of recommended multipliers. 34 | 35 | multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32. 36 | period: (a*2^31)-1 37 | 38 | */ 39 | 40 | #ifndef SDL_test_random_h_ 41 | #define SDL_test_random_h_ 42 | 43 | #include "begin_code.h" 44 | /* Set up for C function definitions, even when using C++ */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /* --- Definitions */ 50 | 51 | /* 52 | * Macros that return a random number in a specific format. 53 | */ 54 | #define SDLTest_RandomInt(c) ((int)SDLTest_Random(c)) 55 | 56 | /* 57 | * Context structure for the random number generator state. 58 | */ 59 | typedef struct { 60 | unsigned int a; 61 | unsigned int x; 62 | unsigned int c; 63 | unsigned int ah; 64 | unsigned int al; 65 | } SDLTest_RandomContext; 66 | 67 | 68 | /* --- Function prototypes */ 69 | 70 | /** 71 | * \brief Initialize random number generator with two integers. 72 | * 73 | * Note: The random sequence of numbers returned by ...Random() is the 74 | * same for the same two integers and has a period of 2^31. 75 | * 76 | * \param rndContext pointer to context structure 77 | * \param xi integer that defines the random sequence 78 | * \param ci integer that defines the random sequence 79 | * 80 | */ 81 | void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, 82 | unsigned int ci); 83 | 84 | /** 85 | * \brief Initialize random number generator based on current system time. 86 | * 87 | * \param rndContext pointer to context structure 88 | * 89 | */ 90 | void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext); 91 | 92 | 93 | /** 94 | * \brief Initialize random number generator based on current system time. 95 | * 96 | * Note: ...RandomInit() or ...RandomInitTime() must have been called 97 | * before using this function. 98 | * 99 | * \param rndContext pointer to context structure 100 | * 101 | * \returns a random number (32bit unsigned integer) 102 | * 103 | */ 104 | unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext); 105 | 106 | 107 | /* Ends C function definitions when using C++ */ 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | #include "close_code.h" 112 | 113 | #endif /* SDL_test_random_h_ */ 114 | 115 | /* vi: set ts=4 sw=4 expandtab: */ 116 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_test_assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_assert.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | * 32 | * Assert API for test code and test cases 33 | * 34 | */ 35 | 36 | #ifndef SDL_test_assert_h_ 37 | #define SDL_test_assert_h_ 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \brief Fails the assert. 47 | */ 48 | #define ASSERT_FAIL 0 49 | 50 | /** 51 | * \brief Passes the assert. 52 | */ 53 | #define ASSERT_PASS 1 54 | 55 | /** 56 | * \brief Assert that logs and break execution flow on failures. 57 | * 58 | * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). 59 | * \param assertDescription Message to log with the assert describing it. 60 | */ 61 | void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); 62 | 63 | /** 64 | * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters. 65 | * 66 | * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). 67 | * \param assertDescription Message to log with the assert describing it. 68 | * 69 | * \returns the assertCondition so it can be used to externally to break execution flow if desired. 70 | */ 71 | int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); 72 | 73 | /** 74 | * \brief Explicitly pass without checking an assertion condition. Updates assertion counter. 75 | * 76 | * \param assertDescription Message to log with the assert describing it. 77 | */ 78 | void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1); 79 | 80 | /** 81 | * \brief Resets the assert summary counters to zero. 82 | */ 83 | void SDLTest_ResetAssertSummary(void); 84 | 85 | /** 86 | * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR. 87 | */ 88 | void SDLTest_LogAssertSummary(void); 89 | 90 | 91 | /** 92 | * \brief Converts the current assert summary state to a test result. 93 | * 94 | * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT 95 | */ 96 | int SDLTest_AssertSummaryToTestResult(void); 97 | 98 | #ifdef __cplusplus 99 | } 100 | #endif 101 | #include "close_code.h" 102 | 103 | #endif /* SDL_test_assert_h_ */ 104 | 105 | /* vi: set ts=4 sw=4 expandtab: */ 106 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_config_wiz.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_wiz_h_ 23 | #define SDL_config_wiz_h_ 24 | #define SDL_config_h_ 25 | 26 | /* This is a set of defines to configure the SDL features */ 27 | 28 | /* General platform specific identifiers */ 29 | #include "SDL_platform.h" 30 | 31 | #define SDL_BYTEORDER 1234 32 | 33 | #define HAVE_ALLOCA_H 1 34 | #define HAVE_SYS_TYPES_H 1 35 | #define HAVE_STDIO_H 1 36 | #define STDC_HEADERS 1 37 | #define HAVE_STDLIB_H 1 38 | #define HAVE_STDARG_H 1 39 | #define HAVE_MALLOC_H 1 40 | #define HAVE_MEMORY_H 1 41 | #define HAVE_STRING_H 1 42 | #define HAVE_STRINGS_H 1 43 | #define HAVE_INTTYPES_H 1 44 | #define HAVE_STDINT_H 1 45 | #define HAVE_CTYPE_H 1 46 | #define HAVE_MATH_H 1 47 | #define HAVE_ICONV_H 1 48 | #define HAVE_SIGNAL_H 1 49 | #define HAVE_MALLOC 1 50 | #define HAVE_CALLOC 1 51 | #define HAVE_REALLOC 1 52 | #define HAVE_FREE 1 53 | #define HAVE_ALLOCA 1 54 | #define HAVE_GETENV 1 55 | #define HAVE_SETENV 1 56 | #define HAVE_PUTENV 1 57 | #define HAVE_UNSETENV 1 58 | #define HAVE_QSORT 1 59 | #define HAVE_ABS 1 60 | #define HAVE_BCOPY 1 61 | #define HAVE_MEMSET 1 62 | #define HAVE_MEMCPY 1 63 | #define HAVE_MEMMOVE 1 64 | #define HAVE_STRLEN 1 65 | #define HAVE_STRDUP 1 66 | #define HAVE_STRCHR 1 67 | #define HAVE_STRRCHR 1 68 | #define HAVE_STRSTR 1 69 | #define HAVE_STRTOL 1 70 | #define HAVE_STRTOUL 1 71 | #define HAVE_STRTOLL 1 72 | #define HAVE_STRTOULL 1 73 | #define HAVE_ATOI 1 74 | #define HAVE_ATOF 1 75 | #define HAVE_STRCMP 1 76 | #define HAVE_STRNCMP 1 77 | #define HAVE_STRCASECMP 1 78 | #define HAVE_STRNCASECMP 1 79 | #define HAVE_VSSCANF 1 80 | #define HAVE_VSNPRINTF 1 81 | #define HAVE_M_PI 1 82 | #define HAVE_CEIL 1 83 | #define HAVE_COPYSIGN 1 84 | #define HAVE_COS 1 85 | #define HAVE_COSF 1 86 | #define HAVE_FABS 1 87 | #define HAVE_FLOOR 1 88 | #define HAVE_LOG 1 89 | #define HAVE_SCALBN 1 90 | #define HAVE_SIN 1 91 | #define HAVE_SINF 1 92 | #define HAVE_SQRT 1 93 | #define HAVE_SQRTF 1 94 | #define HAVE_TAN 1 95 | #define HAVE_TANF 1 96 | #define HAVE_SIGACTION 1 97 | #define HAVE_SETJMP 1 98 | #define HAVE_NANOSLEEP 1 99 | #define HAVE_POW 1 100 | 101 | #define SDL_AUDIO_DRIVER_DUMMY 1 102 | #define SDL_AUDIO_DRIVER_OSS 1 103 | 104 | #define SDL_INPUT_LINUXEV 1 105 | #define SDL_INPUT_TSLIB 1 106 | #define SDL_JOYSTICK_LINUX 1 107 | #define SDL_HAPTIC_LINUX 1 108 | 109 | #define SDL_LOADSO_DLOPEN 1 110 | 111 | #define SDL_THREAD_PTHREAD 1 112 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 113 | 114 | #define SDL_TIMER_UNIX 1 115 | 116 | #define SDL_VIDEO_DRIVER_DUMMY 1 117 | #define SDL_VIDEO_DRIVER_PANDORA 1 118 | #define SDL_VIDEO_RENDER_OGL_ES 1 119 | #define SDL_VIDEO_OPENGL_ES 1 120 | 121 | #endif /* SDL_config_wiz_h_ */ 122 | -------------------------------------------------------------------------------- /scrsndcpy/Utility/Logger.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | 5 | #include "stdafx.h" 6 | #include "Logger.h" 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | namespace attrs = boost::log::attributes; 13 | namespace expr = boost::log::expressions; 14 | namespace sinks = boost::log::sinks; 15 | namespace keywords = boost::log::keywords; 16 | namespace logging = boost::log; 17 | 18 | //#ifdef _DEBUG 19 | #define SHOW_CONSOLE 20 | //#endif 21 | 22 | //Defines a global logger initialization routine 23 | BOOST_LOG_GLOBAL_LOGGER_INIT(my_logger, logger_t) 24 | { 25 | logger_t lg; 26 | 27 | logging::add_common_attributes(); 28 | 29 | #if 0 30 | auto flsink = logging::add_file_log( 31 | boost::log::keywords::file_name = SYS_LOGFILE, 32 | boost::log::keywords::format = ( 33 | expr::stream << expr::format_date_time< boost::posix_time::ptime >("TimeStamp", "%Y-%m-%d %H:%M:%S") 34 | << " [" << expr::attr< boost::log::trivial::severity_level >("Severity") << "]: " 35 | << expr::wmessage 36 | ) 37 | ); 38 | 39 | flsink->imbue(std::locale(std::locale(), new std::codecvt_utf8_utf16)); 40 | #endif 41 | 42 | boost::shared_ptr core = logging::core::get(); 43 | 44 | #if 0 45 | boost::shared_ptr ostream_backend = 46 | boost::make_shared(); 47 | ostream_backend->add_stream( 48 | boost::shared_ptr(&std::clog, logging::empty_deleter())); 49 | ostream_backend->auto_flush(true); 50 | 51 | typedef sinks::synchronous_sink sink_ostream_t; 52 | boost::shared_ptr sink_ostream(new sink_ostream_t(ostream_backend)); 53 | sink_ostream->set_formatter( 54 | expr::format("[%1%] [%2%]\t%3%") 55 | % expr::format_date_time("TimeStamp", "%Y-%m-%d %H:%M:%S.%f") 56 | % logging::trivial::severity 57 | % expr::message); 58 | 59 | core->add_sink(sink_ostream); 60 | #endif 61 | 62 | // ログのファイル出力を設定 63 | auto text_backend = boost::make_shared( 64 | //boost::log::keywords::file_name = SYS_LOGFILE 65 | boost::log::keywords::file_name = LogFileName() 66 | ); 67 | text_backend->auto_flush(true); 68 | 69 | typedef sinks::synchronous_sink sink_text_t; 70 | boost::shared_ptr sink_text(new sink_text_t(text_backend)); 71 | 72 | sink_text->set_formatter( 73 | expr::format("%1% [%2%]: %3%") 74 | % expr::format_date_time("TimeStamp", "%Y-%m-%d %H:%M:%S") 75 | % logging::trivial::severity 76 | % expr::wmessage); 77 | sink_text->imbue(std::locale(std::locale(), new std::codecvt_utf8_utf16)); 78 | core->add_sink(sink_text); 79 | 80 | #ifdef SHOW_CONSOLE//_DEBUG 81 | // ログのコンソール出力を設定 82 | //setlocale(LC_ALL, ""); 83 | 84 | ::AllocConsole(); 85 | //::SetConsoleOutputCP(CP_UTF8); 86 | FILE* out = nullptr; 87 | freopen_s(&out, "CON", "w", stdout); 88 | 89 | std::wcout.imbue(std::locale("")); 90 | 91 | auto console_sink = logging::add_console_log(std::wcout); 92 | console_sink->set_formatter( 93 | expr::format(L"%1% [%2%]: %3%") 94 | % expr::format_date_time("TimeStamp", "%Y-%m-%d %H:%M:%S") 95 | % logging::trivial::severity 96 | % expr::wmessage); 97 | console_sink->imbue(std::locale(std::locale(), new std::codecvt_utf8_utf16)); 98 | #endif 99 | 100 | logging::core::get()->set_filter 101 | ( 102 | #ifdef _DEBUG 103 | logging::trivial::severity >= logging::trivial::info 104 | #else 105 | logging::trivial::severity >= logging::trivial::info/* logging::trivial::warning*/ 106 | #endif 107 | ); 108 | 109 | return lg; 110 | } 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_bits.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_bits.h 24 | * 25 | * Functions for fiddling with bits and bitmasks. 26 | */ 27 | 28 | #ifndef SDL_bits_h_ 29 | #define SDL_bits_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \file SDL_bits.h 41 | */ 42 | 43 | /** 44 | * Get the index of the most significant bit. Result is undefined when called 45 | * with 0. This operation can also be stated as "count leading zeroes" and 46 | * "log base 2". 47 | * 48 | * \return the index of the most significant bit, or -1 if the value is 0. 49 | */ 50 | #if defined(__WATCOMC__) && defined(__386__) 51 | extern _inline int _SDL_bsr_watcom (Uint32); 52 | #pragma aux _SDL_bsr_watcom = \ 53 | "bsr eax, eax" \ 54 | parm [eax] nomemory \ 55 | value [eax] \ 56 | modify exact [eax] nomemory; 57 | #endif 58 | 59 | SDL_FORCE_INLINE int 60 | SDL_MostSignificantBitIndex32(Uint32 x) 61 | { 62 | #if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 63 | /* Count Leading Zeroes builtin in GCC. 64 | * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html 65 | */ 66 | if (x == 0) { 67 | return -1; 68 | } 69 | return 31 - __builtin_clz(x); 70 | #elif defined(__WATCOMC__) && defined(__386__) 71 | if (x == 0) { 72 | return -1; 73 | } 74 | return _SDL_bsr_watcom(x); 75 | #elif defined(_MSC_VER) 76 | unsigned long index; 77 | if (_BitScanReverse(&index, x)) { 78 | return index; 79 | } 80 | return -1; 81 | #else 82 | /* Based off of Bit Twiddling Hacks by Sean Eron Anderson 83 | * , released in the public domain. 84 | * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog 85 | */ 86 | const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; 87 | const int S[] = {1, 2, 4, 8, 16}; 88 | 89 | int msbIndex = 0; 90 | int i; 91 | 92 | if (x == 0) { 93 | return -1; 94 | } 95 | 96 | for (i = 4; i >= 0; i--) 97 | { 98 | if (x & b[i]) 99 | { 100 | x >>= S[i]; 101 | msbIndex |= S[i]; 102 | } 103 | } 104 | 105 | return msbIndex; 106 | #endif 107 | } 108 | 109 | SDL_FORCE_INLINE SDL_bool 110 | SDL_HasExactlyOneBitSet32(Uint32 x) 111 | { 112 | if (x && !(x & (x - 1))) { 113 | return SDL_TRUE; 114 | } 115 | return SDL_FALSE; 116 | } 117 | 118 | /* Ends C function definitions when using C++ */ 119 | #ifdef __cplusplus 120 | } 121 | #endif 122 | #include "close_code.h" 123 | 124 | #endif /* SDL_bits_h_ */ 125 | 126 | /* vi: set ts=4 sw=4 expandtab: */ 127 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_config_pandora.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_pandora_h_ 23 | #define SDL_config_pandora_h_ 24 | #define SDL_config_h_ 25 | 26 | /* This is a set of defines to configure the SDL features */ 27 | 28 | /* General platform specific identifiers */ 29 | #include "SDL_platform.h" 30 | 31 | #ifdef __LP64__ 32 | #define SIZEOF_VOIDP 8 33 | #else 34 | #define SIZEOF_VOIDP 4 35 | #endif 36 | 37 | #define SDL_BYTEORDER 1234 38 | 39 | #define HAVE_ALLOCA_H 1 40 | #define HAVE_SYS_TYPES_H 1 41 | #define HAVE_STDIO_H 1 42 | #define STDC_HEADERS 1 43 | #define HAVE_STDLIB_H 1 44 | #define HAVE_STDARG_H 1 45 | #define HAVE_MALLOC_H 1 46 | #define HAVE_MEMORY_H 1 47 | #define HAVE_STRING_H 1 48 | #define HAVE_STRINGS_H 1 49 | #define HAVE_INTTYPES_H 1 50 | #define HAVE_STDINT_H 1 51 | #define HAVE_CTYPE_H 1 52 | #define HAVE_MATH_H 1 53 | #define HAVE_ICONV_H 1 54 | #define HAVE_SIGNAL_H 1 55 | #define HAVE_MALLOC 1 56 | #define HAVE_CALLOC 1 57 | #define HAVE_REALLOC 1 58 | #define HAVE_FREE 1 59 | #define HAVE_ALLOCA 1 60 | #define HAVE_GETENV 1 61 | #define HAVE_SETENV 1 62 | #define HAVE_PUTENV 1 63 | #define HAVE_UNSETENV 1 64 | #define HAVE_QSORT 1 65 | #define HAVE_ABS 1 66 | #define HAVE_BCOPY 1 67 | #define HAVE_MEMSET 1 68 | #define HAVE_MEMCPY 1 69 | #define HAVE_MEMMOVE 1 70 | #define HAVE_STRLEN 1 71 | #define HAVE_STRDUP 1 72 | #define HAVE_STRCHR 1 73 | #define HAVE_STRRCHR 1 74 | #define HAVE_STRSTR 1 75 | #define HAVE_STRTOL 1 76 | #define HAVE_STRTOUL 1 77 | #define HAVE_STRTOLL 1 78 | #define HAVE_STRTOULL 1 79 | #define HAVE_ATOI 1 80 | #define HAVE_ATOF 1 81 | #define HAVE_STRCMP 1 82 | #define HAVE_STRNCMP 1 83 | #define HAVE_STRCASECMP 1 84 | #define HAVE_STRNCASECMP 1 85 | #define HAVE_VSSCANF 1 86 | #define HAVE_VSNPRINTF 1 87 | #define HAVE_M_PI 1 88 | #define HAVE_CEIL 1 89 | #define HAVE_COPYSIGN 1 90 | #define HAVE_COS 1 91 | #define HAVE_COSF 1 92 | #define HAVE_FABS 1 93 | #define HAVE_FLOOR 1 94 | #define HAVE_LOG 1 95 | #define HAVE_SCALBN 1 96 | #define HAVE_SIN 1 97 | #define HAVE_SINF 1 98 | #define HAVE_SQRT 1 99 | #define HAVE_SQRTF 1 100 | #define HAVE_TAN 1 101 | #define HAVE_TANF 1 102 | #define HAVE_SIGACTION 1 103 | #define HAVE_SETJMP 1 104 | #define HAVE_NANOSLEEP 1 105 | 106 | #define SDL_AUDIO_DRIVER_DUMMY 1 107 | #define SDL_AUDIO_DRIVER_OSS 1 108 | 109 | #define SDL_INPUT_LINUXEV 1 110 | #define SDL_INPUT_TSLIB 1 111 | #define SDL_JOYSTICK_LINUX 1 112 | #define SDL_HAPTIC_LINUX 1 113 | 114 | #define SDL_LOADSO_DLOPEN 1 115 | 116 | #define SDL_THREAD_PTHREAD 1 117 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 118 | 119 | #define SDL_TIMER_UNIX 1 120 | #define SDL_FILESYSTEM_UNIX 1 121 | 122 | #define SDL_VIDEO_DRIVER_DUMMY 1 123 | #define SDL_VIDEO_DRIVER_X11 1 124 | #define SDL_VIDEO_DRIVER_PANDORA 1 125 | #define SDL_VIDEO_RENDER_OGL_ES 1 126 | #define SDL_VIDEO_OPENGL_ES 1 127 | 128 | #endif /* SDL_config_pandora_h_ */ 129 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_gesture.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_gesture.h 24 | * 25 | * Include file for SDL gesture event handling. 26 | */ 27 | 28 | #ifndef SDL_gesture_h_ 29 | #define SDL_gesture_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "SDL_touch.h" 36 | 37 | 38 | #include "begin_code.h" 39 | /* Set up for C function definitions, even when using C++ */ 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef Sint64 SDL_GestureID; 45 | 46 | /* Function prototypes */ 47 | 48 | /** 49 | * Begin recording a gesture on a specified touch device or all touch devices. 50 | * 51 | * If the parameter `touchId` is -1 (i.e., all devices), this function will 52 | * always return 1, regardless of whether there actually are any devices. 53 | * 54 | * \param touchId the touch device id, or -1 for all touch devices 55 | * \returns 1 on success or 0 if the specified device could not be found. 56 | * 57 | * \since This function is available since SDL 2.0.0. 58 | * 59 | * \sa SDL_GetTouchDevice 60 | */ 61 | extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); 62 | 63 | 64 | /** 65 | * Save all currently loaded Dollar Gesture templates. 66 | * 67 | * \param dst a SDL_RWops to save to 68 | * \returns the number of saved templates on success or 0 on failure; call 69 | * SDL_GetError() for more information. 70 | * 71 | * \since This function is available since SDL 2.0.0. 72 | * 73 | * \sa SDL_LoadDollarTemplates 74 | * \sa SDL_SaveDollarTemplate 75 | */ 76 | extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); 77 | 78 | /** 79 | * Save a currently loaded Dollar Gesture template. 80 | * 81 | * \param gestureId a gesture id 82 | * \param dst a SDL_RWops to save to 83 | * \returns 1 on success or 0 on failure; call SDL_GetError() for more 84 | * information. 85 | * 86 | * \since This function is available since SDL 2.0.0. 87 | * 88 | * \sa SDL_LoadDollarTemplates 89 | * \sa SDL_SaveAllDollarTemplates 90 | */ 91 | extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); 92 | 93 | 94 | /** 95 | * Load Dollar Gesture templates from a file. 96 | * 97 | * \param touchId a touch id 98 | * \param src a SDL_RWops to load from 99 | * \returns the number of loaded templates on success or a negative error code 100 | * (or 0) on failure; call SDL_GetError() for more information. 101 | * 102 | * \since This function is available since SDL 2.0.0. 103 | * 104 | * \sa SDL_SaveAllDollarTemplates 105 | * \sa SDL_SaveDollarTemplate 106 | */ 107 | extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); 108 | 109 | /* Ends C function definitions when using C++ */ 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | #include "close_code.h" 114 | 115 | #endif /* SDL_gesture_h_ */ 116 | 117 | /* vi: set ts=4 sw=4 expandtab: */ 118 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_test_crc32.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_crc32.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Implements CRC32 calculations (default output is Perl String::CRC32 compatible). 33 | 34 | */ 35 | 36 | #ifndef SDL_test_crc32_h_ 37 | #define SDL_test_crc32_h_ 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | 46 | /* ------------ Definitions --------- */ 47 | 48 | /* Definition shared by all CRC routines */ 49 | 50 | #ifndef CrcUint32 51 | #define CrcUint32 unsigned int 52 | #endif 53 | #ifndef CrcUint8 54 | #define CrcUint8 unsigned char 55 | #endif 56 | 57 | #ifdef ORIGINAL_METHOD 58 | #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */ 59 | #else 60 | #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */ 61 | #endif 62 | 63 | /** 64 | * Data structure for CRC32 (checksum) computation 65 | */ 66 | typedef struct { 67 | CrcUint32 crc32_table[256]; /* CRC table */ 68 | } SDLTest_Crc32Context; 69 | 70 | /* ---------- Function Prototypes ------------- */ 71 | 72 | /** 73 | * \brief Initialize the CRC context 74 | * 75 | * Note: The function initializes the crc table required for all crc calculations. 76 | * 77 | * \param crcContext pointer to context variable 78 | * 79 | * \returns 0 for OK, -1 on error 80 | * 81 | */ 82 | int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext); 83 | 84 | 85 | /** 86 | * \brief calculate a crc32 from a data block 87 | * 88 | * \param crcContext pointer to context variable 89 | * \param inBuf input buffer to checksum 90 | * \param inLen length of input buffer 91 | * \param crc32 pointer to Uint32 to store the final CRC into 92 | * 93 | * \returns 0 for OK, -1 on error 94 | * 95 | */ 96 | int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); 97 | 98 | /* Same routine broken down into three steps */ 99 | int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); 100 | int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); 101 | int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); 102 | 103 | 104 | /** 105 | * \brief clean up CRC context 106 | * 107 | * \param crcContext pointer to context variable 108 | * 109 | * \returns 0 for OK, -1 on error 110 | * 111 | */ 112 | 113 | int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext); 114 | 115 | 116 | /* Ends C function definitions when using C++ */ 117 | #ifdef __cplusplus 118 | } 119 | #endif 120 | #include "close_code.h" 121 | 122 | #endif /* SDL_test_crc32_h_ */ 123 | 124 | /* vi: set ts=4 sw=4 expandtab: */ 125 | -------------------------------------------------------------------------------- /scrsndcpy/Config.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Config.h" 3 | 4 | #include 5 | #include 6 | 7 | #include "Utility\CodeConvert.h" 8 | #include "Utility\CommonUtility.h" 9 | #include "Utility\json.hpp" 10 | 11 | using json = nlohmann::json; 12 | using namespace CodeConvert; 13 | 14 | constexpr char obfuscation = 47; 15 | 16 | 17 | bool Config::LoadConfig() 18 | { 19 | std::ifstream fs((GetExeDirectory() / "setting.json").wstring()); 20 | if (!fs) { 21 | return true; 22 | } 23 | json jsonSetting; 24 | fs >> jsonSetting; 25 | 26 | if (jsonSetting["Config"].is_null()) { 27 | return true; // default 28 | } 29 | 30 | autoStart = jsonSetting["Config"].value("AutoStart", autoStart); 31 | std::string obfuPass = jsonSetting["Config"].value("LoginPassword", ""); 32 | if (obfuPass.length()) { 33 | ATLASSERT(obfuPass.length() % 3 == 0); 34 | for (LPCSTR str = obfuPass.c_str(); *str != '\0'; str += 3) { 35 | ATLASSERT(*str == '\\'); 36 | unsigned int chex = 0; 37 | sscanf(&str[1], "%x", &chex); 38 | chex ^= obfuscation; 39 | loginPassword += static_cast(chex); 40 | } 41 | 42 | } 43 | autoWifiConnect = jsonSetting["Config"].value("AutoWifiConnect", autoWifiConnect); 44 | reconnectOnResume = jsonSetting["Config"].value("ReconnectOnResume", reconnectOnResume); 45 | enableUHID = jsonSetting["Config"].value("EnableUHID", enableUHID); 46 | useScrcpyAudio = jsonSetting["Config"].value("UseScrcpyAudio", useScrcpyAudio); 47 | 48 | // scrcpy 49 | maxSize = jsonSetting["Config"].value("MaxSize", maxSize); 50 | maxFPS = jsonSetting["Config"].value("MaxFPS", maxFPS); 51 | bitrate = jsonSetting["Config"].value("Bitrate", bitrate); 52 | turnScreenOff = jsonSetting["Config"].value("TurnScreenOff", turnScreenOff); 53 | delayFrameCount = jsonSetting["Config"].value("DelayFrameCount", delayFrameCount); 54 | videoBuffer_ms = jsonSetting["Config"].value("VideoBuffer_ms", videoBuffer_ms); 55 | noResize = jsonSetting["Config"].value("NoResize", noResize); 56 | 57 | // sndcpy 58 | bufferMultiple = jsonSetting["Config"].value("BufferMultiple", bufferMultiple); 59 | maxBufferSampleCount = jsonSetting["Config"].value("MaxBufferSampleCount", maxBufferSampleCount); 60 | deviceMuteOnStart = jsonSetting["Config"].value("DeviceMuteOnStart", deviceMuteOnStart); 61 | toggleMuteReverse = jsonSetting["Config"].value("ToggleMuteReverse", toggleMuteReverse); 62 | 63 | return true; 64 | } 65 | 66 | void Config::SaveConfig() 67 | { 68 | json jsonSetting; 69 | std::ifstream fs((GetExeDirectory() / "setting.json").wstring()); 70 | if (fs) { 71 | fs >> jsonSetting; 72 | } 73 | fs.close(); 74 | 75 | jsonSetting["Config"]["AutoStart"] = autoStart; 76 | 77 | std::stringstream ss; 78 | for (const char& c : loginPassword) { 79 | ss << "\\" << std::setfill('0') << std::setw(2) << std::hex << (c ^ obfuscation); 80 | //obfuPass.push_back(c ^ obfuscation); 81 | } 82 | std::string obfuPass = ss.str(); 83 | jsonSetting["Config"]["LoginPassword"] = obfuPass; 84 | jsonSetting["Config"]["AutoWifiConnect"] = autoWifiConnect; 85 | jsonSetting["Config"]["ReconnectOnResume"] = reconnectOnResume; 86 | jsonSetting["Config"]["EnableUHID"] = enableUHID; 87 | jsonSetting["Config"]["UseScrcpyAudio"] = useScrcpyAudio; 88 | 89 | jsonSetting["Config"]["MaxSize"] = maxSize; 90 | jsonSetting["Config"]["MaxFPS"] = maxFPS; 91 | jsonSetting["Config"]["Bitrate"] = bitrate; 92 | jsonSetting["Config"]["TurnScreenOff"] = turnScreenOff; 93 | jsonSetting["Config"]["DelayFrameCount"] = delayFrameCount; 94 | jsonSetting["Config"]["VideoBuffer_ms"] = videoBuffer_ms; 95 | jsonSetting["Config"]["NoResize"] = noResize; 96 | 97 | jsonSetting["Config"]["BufferMultiple"] = bufferMultiple; 98 | jsonSetting["Config"]["MaxBufferSampleCount"] = maxBufferSampleCount; 99 | jsonSetting["Config"]["DeviceMuteOnStart"] = deviceMuteOnStart; 100 | jsonSetting["Config"]["ToggleMuteReverse"] = toggleMuteReverse; 101 | 102 | std::ofstream ofs((GetExeDirectory() / "setting.json").wstring()); 103 | ofs << jsonSetting.dump(4); 104 | } 105 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_locale.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_locale.h 24 | * 25 | * Include file for SDL locale services 26 | */ 27 | 28 | #ifndef _SDL_locale_h 29 | #define _SDL_locale_h 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | #include "begin_code.h" 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | /* *INDENT-OFF* */ 38 | extern "C" { 39 | /* *INDENT-ON* */ 40 | #endif 41 | 42 | 43 | typedef struct SDL_Locale 44 | { 45 | const char *language; /**< A language name, like "en" for English. */ 46 | const char *country; /**< A country, like "US" for America. Can be NULL. */ 47 | } SDL_Locale; 48 | 49 | /** 50 | * Report the user's preferred locale. 51 | * 52 | * This returns an array of SDL_Locale structs, the final item zeroed out. 53 | * When the caller is done with this array, it should call SDL_free() on the 54 | * returned value; all the memory involved is allocated in a single block, so 55 | * a single SDL_free() will suffice. 56 | * 57 | * Returned language strings are in the format xx, where 'xx' is an ISO-639 58 | * language specifier (such as "en" for English, "de" for German, etc). 59 | * Country strings are in the format YY, where "YY" is an ISO-3166 country 60 | * code (such as "US" for the United States, "CA" for Canada, etc). Country 61 | * might be NULL if there's no specific guidance on them (so you might get { 62 | * "en", "US" } for American English, but { "en", NULL } means "English 63 | * language, generically"). Language strings are never NULL, except to 64 | * terminate the array. 65 | * 66 | * Please note that not all of these strings are 2 characters; some are three 67 | * or more. 68 | * 69 | * The returned list of locales are in the order of the user's preference. For 70 | * example, a German citizen that is fluent in US English and knows enough 71 | * Japanese to navigate around Tokyo might have a list like: { "de", "en_US", 72 | * "jp", NULL }. Someone from England might prefer British English (where 73 | * "color" is spelled "colour", etc), but will settle for anything like it: { 74 | * "en_GB", "en", NULL }. 75 | * 76 | * This function returns NULL on error, including when the platform does not 77 | * supply this information at all. 78 | * 79 | * This might be a "slow" call that has to query the operating system. It's 80 | * best to ask for this once and save the results. However, this list can 81 | * change, usually because the user has changed a system preference outside of 82 | * your program; SDL will send an SDL_LOCALECHANGED event in this case, if 83 | * possible, and you can call this function again to get an updated copy of 84 | * preferred locales. 85 | * 86 | * \return array of locales, terminated with a locale with a NULL language 87 | * field. Will return NULL on error. 88 | */ 89 | extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void); 90 | 91 | /* Ends C function definitions when using C++ */ 92 | #ifdef __cplusplus 93 | /* *INDENT-OFF* */ 94 | } 95 | /* *INDENT-ON* */ 96 | #endif 97 | #include "close_code.h" 98 | 99 | #endif /* _SDL_locale_h */ 100 | 101 | /* vi: set ts=4 sw=4 expandtab: */ 102 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_loadso.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_loadso.h 24 | * 25 | * System dependent library loading routines 26 | * 27 | * Some things to keep in mind: 28 | * \li These functions only work on C function names. Other languages may 29 | * have name mangling and intrinsic language support that varies from 30 | * compiler to compiler. 31 | * \li Make sure you declare your function pointers with the same calling 32 | * convention as the actual library function. Your code will crash 33 | * mysteriously if you do not do this. 34 | * \li Avoid namespace collisions. If you load a symbol from the library, 35 | * it is not defined whether or not it goes into the global symbol 36 | * namespace for the application. If it does and it conflicts with 37 | * symbols in your code or other shared libraries, you will not get 38 | * the results you expect. :) 39 | */ 40 | 41 | #ifndef SDL_loadso_h_ 42 | #define SDL_loadso_h_ 43 | 44 | #include "SDL_stdinc.h" 45 | #include "SDL_error.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /** 54 | * Dynamically load a shared object. 55 | * 56 | * \param sofile a system-dependent name of the object file 57 | * \returns an opaque pointer to the object handle or NULL if there was an 58 | * error; call SDL_GetError() for more information. 59 | * 60 | * \sa SDL_LoadFunction 61 | * \sa SDL_UnloadObject 62 | */ 63 | extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); 64 | 65 | /** 66 | * Look up the address of the named function in a shared object. 67 | * 68 | * This function pointer is no longer valid after calling SDL_UnloadObject(). 69 | * 70 | * This function can only look up C function names. Other languages may have 71 | * name mangling and intrinsic language support that varies from compiler to 72 | * compiler. 73 | * 74 | * Make sure you declare your function pointers with the same calling 75 | * convention as the actual library function. Your code will crash 76 | * mysteriously if you do not do this. 77 | * 78 | * If the requested function doesn't exist, NULL is returned. 79 | * 80 | * \param handle a valid shared object handle returned by SDL_LoadObject() 81 | * \param name the name of the function to look up 82 | * \returns a pointer to the function or NULL if there was an error; call 83 | * SDL_GetError() for more information. 84 | * 85 | * \sa SDL_LoadObject 86 | * \sa SDL_UnloadObject 87 | */ 88 | extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, 89 | const char *name); 90 | 91 | /** 92 | * Unload a shared object from memory. 93 | * 94 | * \param handle a valid shared object handle returned by SDL_LoadObject() 95 | * 96 | * \sa SDL_LoadFunction 97 | * \sa SDL_LoadObject 98 | */ 99 | extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); 100 | 101 | /* Ends C function definitions when using C++ */ 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | #include "close_code.h" 106 | 107 | #endif /* SDL_loadso_h_ */ 108 | 109 | /* vi: set ts=4 sw=4 expandtab: */ 110 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_config_psp.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_psp_h_ 23 | #define SDL_config_psp_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | 29 | 30 | #ifdef __GNUC__ 31 | #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 32 | #endif 33 | 34 | #define HAVE_GCC_ATOMICS 1 35 | 36 | #define HAVE_ALLOCA_H 1 37 | #define HAVE_SYS_TYPES_H 1 38 | #define HAVE_STDIO_H 1 39 | #define STDC_HEADERS 1 40 | #define HAVE_STRING_H 1 41 | #define HAVE_INTTYPES_H 1 42 | #define HAVE_STDINT_H 1 43 | #define HAVE_CTYPE_H 1 44 | #define HAVE_MATH_H 1 45 | #define HAVE_SIGNAL_H 1 46 | 47 | /* C library functions */ 48 | #define HAVE_MALLOC 1 49 | #define HAVE_CALLOC 1 50 | #define HAVE_REALLOC 1 51 | #define HAVE_FREE 1 52 | #define HAVE_ALLOCA 1 53 | #define HAVE_GETENV 1 54 | #define HAVE_SETENV 1 55 | #define HAVE_PUTENV 1 56 | #define HAVE_SETENV 1 57 | #define HAVE_UNSETENV 1 58 | #define HAVE_QSORT 1 59 | #define HAVE_ABS 1 60 | #define HAVE_BCOPY 1 61 | #define HAVE_MEMSET 1 62 | #define HAVE_MEMCPY 1 63 | #define HAVE_MEMMOVE 1 64 | #define HAVE_MEMCMP 1 65 | #define HAVE_STRLEN 1 66 | #define HAVE_STRLCPY 1 67 | #define HAVE_STRLCAT 1 68 | #define HAVE_STRDUP 1 69 | #define HAVE_STRCHR 1 70 | #define HAVE_STRRCHR 1 71 | #define HAVE_STRSTR 1 72 | #define HAVE_STRTOL 1 73 | #define HAVE_STRTOUL 1 74 | #define HAVE_STRTOLL 1 75 | #define HAVE_STRTOULL 1 76 | #define HAVE_STRTOD 1 77 | #define HAVE_ATOI 1 78 | #define HAVE_ATOF 1 79 | #define HAVE_STRCMP 1 80 | #define HAVE_STRNCMP 1 81 | #define HAVE_STRCASECMP 1 82 | #define HAVE_STRNCASECMP 1 83 | #define HAVE_VSSCANF 1 84 | #define HAVE_VSNPRINTF 1 85 | #define HAVE_M_PI 1 86 | #define HAVE_ATAN 1 87 | #define HAVE_ATAN2 1 88 | #define HAVE_ACOS 1 89 | #define HAVE_ASIN 1 90 | #define HAVE_CEIL 1 91 | #define HAVE_COPYSIGN 1 92 | #define HAVE_COS 1 93 | #define HAVE_COSF 1 94 | #define HAVE_FABS 1 95 | #define HAVE_FLOOR 1 96 | #define HAVE_LOG 1 97 | #define HAVE_POW 1 98 | #define HAVE_SCALBN 1 99 | #define HAVE_SIN 1 100 | #define HAVE_SINF 1 101 | #define HAVE_SQRT 1 102 | #define HAVE_SQRTF 1 103 | #define HAVE_TAN 1 104 | #define HAVE_TANF 1 105 | #define HAVE_SETJMP 1 106 | #define HAVE_NANOSLEEP 1 107 | /* #define HAVE_SYSCONF 1 */ 108 | /* #define HAVE_SIGACTION 1 */ 109 | 110 | 111 | /* PSP isn't that sophisticated */ 112 | #define LACKS_SYS_MMAN_H 1 113 | 114 | /* Enable the stub thread support (src/thread/psp/\*.c) */ 115 | #define SDL_THREAD_PSP 1 116 | 117 | /* Enable the stub timer support (src/timer/psp/\*.c) */ 118 | #define SDL_TIMERS_PSP 1 119 | 120 | /* Enable the stub joystick driver (src/joystick/psp/\*.c) */ 121 | #define SDL_JOYSTICK_PSP 1 122 | 123 | /* Enable the stub audio driver (src/audio/psp/\*.c) */ 124 | #define SDL_AUDIO_DRIVER_PSP 1 125 | 126 | /* PSP video dirver */ 127 | #define SDL_VIDEO_DRIVER_PSP 1 128 | 129 | /* PSP render dirver */ 130 | #define SDL_VIDEO_RENDER_PSP 1 131 | 132 | #define SDL_POWER_PSP 1 133 | 134 | /* !!! FIXME: what does PSP do for filesystem stuff? */ 135 | #define SDL_FILESYSTEM_DUMMY 1 136 | 137 | /* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */ 138 | #define SDL_HAPTIC_DISABLED 1 139 | 140 | /* PSP can't load shared object (src/loadso/dummy/\*.c) */ 141 | #define SDL_LOADSO_DISABLED 1 142 | 143 | 144 | #endif /* SDL_config_psp_h_ */ 145 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_touch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_touch.h 24 | * 25 | * Include file for SDL touch event handling. 26 | */ 27 | 28 | #ifndef SDL_touch_h_ 29 | #define SDL_touch_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "begin_code.h" 36 | /* Set up for C function definitions, even when using C++ */ 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef Sint64 SDL_TouchID; 42 | typedef Sint64 SDL_FingerID; 43 | 44 | typedef enum 45 | { 46 | SDL_TOUCH_DEVICE_INVALID = -1, 47 | SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */ 48 | SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */ 49 | SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */ 50 | } SDL_TouchDeviceType; 51 | 52 | typedef struct SDL_Finger 53 | { 54 | SDL_FingerID id; 55 | float x; 56 | float y; 57 | float pressure; 58 | } SDL_Finger; 59 | 60 | /* Used as the device ID for mouse events simulated with touch input */ 61 | #define SDL_TOUCH_MOUSEID ((Uint32)-1) 62 | 63 | /* Used as the SDL_TouchID for touch events simulated with mouse input */ 64 | #define SDL_MOUSE_TOUCHID ((Sint64)-1) 65 | 66 | 67 | /** 68 | * Get the number of registered touch devices. 69 | * 70 | * On some platforms SDL first sees the touch device if it was actually used. 71 | * Therefore SDL_GetNumTouchDevices() may return 0 although devices are 72 | * available. After using all devices at least once the number will be 73 | * correct. 74 | * 75 | * This was fixed for Android in SDL 2.0.1. 76 | * 77 | * \returns the number of registered touch devices. 78 | * 79 | * \since This function is available since SDL 2.0.0. 80 | * 81 | * \sa SDL_GetTouchDevice 82 | */ 83 | extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); 84 | 85 | /** 86 | * Get the touch ID with the given index. 87 | * 88 | * \param index the touch device index 89 | * \returns the touch ID with the given index on success or 0 if the index is 90 | * invalid; call SDL_GetError() for more information. 91 | * 92 | * \since This function is available since SDL 2.0.0. 93 | * 94 | * \sa SDL_GetNumTouchDevices 95 | */ 96 | extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); 97 | 98 | /** 99 | * Get the type of the given touch device. 100 | */ 101 | extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID); 102 | 103 | /** 104 | * Get the number of active fingers for a given touch device. 105 | * 106 | * \param touchID the ID of a touch device 107 | * \returns the number of active fingers for a given touch device on success 108 | * or 0 on failure; call SDL_GetError() for more information. 109 | * 110 | * \since This function is available since SDL 2.0.0. 111 | * 112 | * \sa SDL_GetTouchFinger 113 | */ 114 | extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); 115 | 116 | /** 117 | * Get the finger object for specified touch device ID and finger index. 118 | * 119 | * The returned resource is owned by SDL and should not be deallocated. 120 | * 121 | * \param touchID the ID of the requested touch device 122 | * \param index the index of the requested finger 123 | * \returns a pointer to the SDL_Finger object or NULL if no object at the 124 | * given ID and index could be found. 125 | * 126 | * \sa SDL_RecordGesture 127 | */ 128 | extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); 129 | 130 | /* Ends C function definitions when using C++ */ 131 | #ifdef __cplusplus 132 | } 133 | #endif 134 | #include "close_code.h" 135 | 136 | #endif /* SDL_touch_h_ */ 137 | 138 | /* vi: set ts=4 sw=4 expandtab: */ 139 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_config_android.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_android_h_ 23 | #define SDL_config_android_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | /** 29 | * \file SDL_config_android.h 30 | * 31 | * This is a configuration that can be used to build SDL for Android 32 | */ 33 | 34 | #include 35 | 36 | #define HAVE_GCC_ATOMICS 1 37 | 38 | #define HAVE_ALLOCA_H 1 39 | #define HAVE_SYS_TYPES_H 1 40 | #define HAVE_STDIO_H 1 41 | #define STDC_HEADERS 1 42 | #define HAVE_STRING_H 1 43 | #define HAVE_INTTYPES_H 1 44 | #define HAVE_STDINT_H 1 45 | #define HAVE_CTYPE_H 1 46 | #define HAVE_MATH_H 1 47 | #define HAVE_SIGNAL_H 1 48 | 49 | /* C library functions */ 50 | #define HAVE_MALLOC 1 51 | #define HAVE_CALLOC 1 52 | #define HAVE_REALLOC 1 53 | #define HAVE_FREE 1 54 | #define HAVE_ALLOCA 1 55 | #define HAVE_GETENV 1 56 | #define HAVE_SETENV 1 57 | #define HAVE_PUTENV 1 58 | #define HAVE_SETENV 1 59 | #define HAVE_UNSETENV 1 60 | #define HAVE_QSORT 1 61 | #define HAVE_ABS 1 62 | #define HAVE_BCOPY 1 63 | #define HAVE_MEMSET 1 64 | #define HAVE_MEMCPY 1 65 | #define HAVE_MEMMOVE 1 66 | #define HAVE_MEMCMP 1 67 | #define HAVE_STRLEN 1 68 | #define HAVE_STRLCPY 1 69 | #define HAVE_STRLCAT 1 70 | #define HAVE_STRDUP 1 71 | #define HAVE_STRCHR 1 72 | #define HAVE_STRRCHR 1 73 | #define HAVE_STRSTR 1 74 | #define HAVE_STRTOL 1 75 | #define HAVE_STRTOUL 1 76 | #define HAVE_STRTOLL 1 77 | #define HAVE_STRTOULL 1 78 | #define HAVE_STRTOD 1 79 | #define HAVE_ATOI 1 80 | #define HAVE_ATOF 1 81 | #define HAVE_STRCMP 1 82 | #define HAVE_STRNCMP 1 83 | #define HAVE_STRCASECMP 1 84 | #define HAVE_STRNCASECMP 1 85 | #define HAVE_VSSCANF 1 86 | #define HAVE_VSNPRINTF 1 87 | #define HAVE_M_PI 1 88 | #define HAVE_ATAN 1 89 | #define HAVE_ATAN2 1 90 | #define HAVE_ACOS 1 91 | #define HAVE_ASIN 1 92 | #define HAVE_CEIL 1 93 | #define HAVE_COPYSIGN 1 94 | #define HAVE_COS 1 95 | #define HAVE_COSF 1 96 | #define HAVE_FABS 1 97 | #define HAVE_FLOOR 1 98 | #define HAVE_LOG 1 99 | #define HAVE_POW 1 100 | #define HAVE_SCALBN 1 101 | #define HAVE_SIN 1 102 | #define HAVE_SINF 1 103 | #define HAVE_SQRT 1 104 | #define HAVE_SQRTF 1 105 | #define HAVE_TAN 1 106 | #define HAVE_TANF 1 107 | #define HAVE_SIGACTION 1 108 | #define HAVE_SETJMP 1 109 | #define HAVE_NANOSLEEP 1 110 | #define HAVE_SYSCONF 1 111 | #define HAVE_CLOCK_GETTIME 1 112 | 113 | #define SIZEOF_VOIDP 4 114 | 115 | /* Enable various audio drivers */ 116 | #define SDL_AUDIO_DRIVER_ANDROID 1 117 | #define SDL_AUDIO_DRIVER_DUMMY 1 118 | 119 | /* Enable various input drivers */ 120 | #define SDL_JOYSTICK_ANDROID 1 121 | #define SDL_HAPTIC_ANDROID 1 122 | 123 | /* Enable various shared object loading systems */ 124 | #define SDL_LOADSO_DLOPEN 1 125 | 126 | /* Enable various threading systems */ 127 | #define SDL_THREAD_PTHREAD 1 128 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 129 | 130 | /* Enable various timer systems */ 131 | #define SDL_TIMER_UNIX 1 132 | 133 | /* Enable various video drivers */ 134 | #define SDL_VIDEO_DRIVER_ANDROID 1 135 | 136 | /* Enable OpenGL ES */ 137 | #define SDL_VIDEO_OPENGL_ES 1 138 | #define SDL_VIDEO_OPENGL_ES2 1 139 | #define SDL_VIDEO_OPENGL_EGL 1 140 | #define SDL_VIDEO_RENDER_OGL_ES 1 141 | #define SDL_VIDEO_RENDER_OGL_ES2 1 142 | 143 | /* Enable Vulkan support */ 144 | /* Android does not support Vulkan in native code using the "armeabi" ABI. */ 145 | #if defined(__ARM_ARCH) && __ARM_ARCH < 7 146 | #define SDL_VIDEO_VULKAN 0 147 | #else 148 | #define SDL_VIDEO_VULKAN 1 149 | #endif 150 | 151 | /* Enable system power support */ 152 | #define SDL_POWER_ANDROID 1 153 | 154 | /* Enable the filesystem driver */ 155 | #define SDL_FILESYSTEM_ANDROID 1 156 | 157 | #endif /* SDL_config_android_h_ */ 158 | -------------------------------------------------------------------------------- /scrsndcpy/scrsndcpy.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {aec0f27d-fc78-45be-a110-339526161a2b} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {183e0b1a-f45d-4a9c-a2da-c93d15b0ce4a} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {9ba34d77-0223-4a1d-ba33-279b1a0cd8e0} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest 15 | 16 | 17 | {e78c5738-94c5-49e9-aa99-f1974c98f168} 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files\Utility 32 | 33 | 34 | Header Files\Utility 35 | 36 | 37 | Header Files\Utility 38 | 39 | 40 | Header Files\Utility 41 | 42 | 43 | Header Files\Utility 44 | 45 | 46 | Header Files 47 | 48 | 49 | Header Files 50 | 51 | 52 | Header Files 53 | 54 | 55 | Header Files 56 | 57 | 58 | Header Files 59 | 60 | 61 | 62 | 63 | Header Files 64 | 65 | 66 | Header Files 67 | 68 | 69 | Header Files 70 | 71 | 72 | Header Files 73 | 74 | 75 | Header Files\Utility 76 | 77 | 78 | Header Files\Utility 79 | 80 | 81 | Header Files\Utility 82 | 83 | 84 | Header Files\Utility 85 | 86 | 87 | Header Files\Utility 88 | 89 | 90 | Header Files\Utility 91 | 92 | 93 | Header Files\Utility 94 | 95 | 96 | Header Files\Utility 97 | 98 | 99 | Header Files\Utility 100 | 101 | 102 | Header Files 103 | 104 | 105 | Header Files 106 | 107 | 108 | Header Files 109 | 110 | 111 | Header Files 112 | 113 | 114 | Header Files 115 | 116 | 117 | 118 | 119 | Resource Files 120 | 121 | 122 | 123 | 124 | Resource Files 125 | 126 | 127 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_config_iphoneos.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_iphoneos_h_ 23 | #define SDL_config_iphoneos_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | #ifdef __LP64__ 29 | #define SIZEOF_VOIDP 8 30 | #else 31 | #define SIZEOF_VOIDP 4 32 | #endif 33 | 34 | #define HAVE_GCC_ATOMICS 1 35 | 36 | #define HAVE_ALLOCA_H 1 37 | #define HAVE_SYS_TYPES_H 1 38 | #define HAVE_STDIO_H 1 39 | #define STDC_HEADERS 1 40 | #define HAVE_STRING_H 1 41 | #define HAVE_INTTYPES_H 1 42 | #define HAVE_STDINT_H 1 43 | #define HAVE_CTYPE_H 1 44 | #define HAVE_MATH_H 1 45 | #define HAVE_SIGNAL_H 1 46 | 47 | /* C library functions */ 48 | #define HAVE_MALLOC 1 49 | #define HAVE_CALLOC 1 50 | #define HAVE_REALLOC 1 51 | #define HAVE_FREE 1 52 | #define HAVE_ALLOCA 1 53 | #define HAVE_GETENV 1 54 | #define HAVE_SETENV 1 55 | #define HAVE_PUTENV 1 56 | #define HAVE_SETENV 1 57 | #define HAVE_UNSETENV 1 58 | #define HAVE_QSORT 1 59 | #define HAVE_ABS 1 60 | #define HAVE_BCOPY 1 61 | #define HAVE_MEMSET 1 62 | #define HAVE_MEMCPY 1 63 | #define HAVE_MEMMOVE 1 64 | #define HAVE_MEMCMP 1 65 | #define HAVE_STRLEN 1 66 | #define HAVE_STRLCPY 1 67 | #define HAVE_STRLCAT 1 68 | #define HAVE_STRDUP 1 69 | #define HAVE_STRCHR 1 70 | #define HAVE_STRRCHR 1 71 | #define HAVE_STRSTR 1 72 | #define HAVE_STRTOL 1 73 | #define HAVE_STRTOUL 1 74 | #define HAVE_STRTOLL 1 75 | #define HAVE_STRTOULL 1 76 | #define HAVE_STRTOD 1 77 | #define HAVE_ATOI 1 78 | #define HAVE_ATOF 1 79 | #define HAVE_STRCMP 1 80 | #define HAVE_STRNCMP 1 81 | #define HAVE_STRCASECMP 1 82 | #define HAVE_STRNCASECMP 1 83 | #define HAVE_VSSCANF 1 84 | #define HAVE_VSNPRINTF 1 85 | #define HAVE_M_PI 1 86 | #define HAVE_ATAN 1 87 | #define HAVE_ATAN2 1 88 | #define HAVE_ACOS 1 89 | #define HAVE_ASIN 1 90 | #define HAVE_CEIL 1 91 | #define HAVE_COPYSIGN 1 92 | #define HAVE_COS 1 93 | #define HAVE_COSF 1 94 | #define HAVE_FABS 1 95 | #define HAVE_FLOOR 1 96 | #define HAVE_LOG 1 97 | #define HAVE_POW 1 98 | #define HAVE_SCALBN 1 99 | #define HAVE_SIN 1 100 | #define HAVE_SINF 1 101 | #define HAVE_SQRT 1 102 | #define HAVE_SQRTF 1 103 | #define HAVE_TAN 1 104 | #define HAVE_TANF 1 105 | #define HAVE_SIGACTION 1 106 | #define HAVE_SETJMP 1 107 | #define HAVE_NANOSLEEP 1 108 | #define HAVE_SYSCONF 1 109 | #define HAVE_SYSCTLBYNAME 1 110 | 111 | /* enable iPhone version of Core Audio driver */ 112 | #define SDL_AUDIO_DRIVER_COREAUDIO 1 113 | /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ 114 | #define SDL_AUDIO_DRIVER_DUMMY 1 115 | 116 | /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ 117 | #define SDL_HAPTIC_DUMMY 1 118 | 119 | /* Enable MFi joystick support */ 120 | #define SDL_JOYSTICK_MFI 1 121 | 122 | /* Enable Unix style SO loading */ 123 | #define SDL_LOADSO_DLOPEN 1 124 | 125 | /* Enable various threading systems */ 126 | #define SDL_THREAD_PTHREAD 1 127 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 128 | 129 | /* Enable various timer systems */ 130 | #define SDL_TIMER_UNIX 1 131 | 132 | /* Supported video drivers */ 133 | #define SDL_VIDEO_DRIVER_UIKIT 1 134 | #define SDL_VIDEO_DRIVER_DUMMY 1 135 | 136 | /* enable OpenGL ES */ 137 | #define SDL_VIDEO_OPENGL_ES2 1 138 | #define SDL_VIDEO_OPENGL_ES 1 139 | #define SDL_VIDEO_RENDER_OGL_ES 1 140 | #define SDL_VIDEO_RENDER_OGL_ES2 1 141 | 142 | /* Enable Vulkan support */ 143 | #if !TARGET_OS_SIMULATOR && !TARGET_CPU_ARM // Only 64-bit devices have Metal 144 | #define SDL_VIDEO_VULKAN 1 145 | #else 146 | #define SDL_VIDEO_VULKAN 0 147 | #endif 148 | 149 | /* Enable system power support */ 150 | #define SDL_POWER_UIKIT 1 151 | 152 | /* enable iPhone keyboard support */ 153 | #define SDL_IPHONE_KEYBOARD 1 154 | 155 | /* enable iOS extended launch screen */ 156 | #define SDL_IPHONE_LAUNCHSCREEN 1 157 | 158 | /* Set max recognized G-force from accelerometer 159 | See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed 160 | */ 161 | #define SDL_IPHONE_MAX_GFORCE 5.0 162 | 163 | /* enable filesystem support */ 164 | #define SDL_FILESYSTEM_COCOA 1 165 | 166 | #endif /* SDL_config_iphoneos_h_ */ 167 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_test_md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_md5.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | *********************************************************************** 32 | ** Header file for implementation of MD5 ** 33 | ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** 34 | ** Created: 2/17/90 RLR ** 35 | ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** 36 | ** Revised (for MD5): RLR 4/27/91 ** 37 | ** -- G modified to have y&~z instead of y&z ** 38 | ** -- FF, GG, HH modified to add in last register done ** 39 | ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** 40 | ** -- distinct additive constant for each step ** 41 | ** -- round 4 added, working mod 7 ** 42 | *********************************************************************** 43 | */ 44 | 45 | /* 46 | *********************************************************************** 47 | ** Message-digest routines: ** 48 | ** To form the message digest for a message M ** 49 | ** (1) Initialize a context buffer mdContext using MD5Init ** 50 | ** (2) Call MD5Update on mdContext and M ** 51 | ** (3) Call MD5Final on mdContext ** 52 | ** The message digest is now in mdContext->digest[0...15] ** 53 | *********************************************************************** 54 | */ 55 | 56 | #ifndef SDL_test_md5_h_ 57 | #define SDL_test_md5_h_ 58 | 59 | #include "begin_code.h" 60 | /* Set up for C function definitions, even when using C++ */ 61 | #ifdef __cplusplus 62 | extern "C" { 63 | #endif 64 | 65 | /* ------------ Definitions --------- */ 66 | 67 | /* typedef a 32-bit type */ 68 | typedef unsigned long int MD5UINT4; 69 | 70 | /* Data structure for MD5 (Message-Digest) computation */ 71 | typedef struct { 72 | MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ 73 | MD5UINT4 buf[4]; /* scratch buffer */ 74 | unsigned char in[64]; /* input buffer */ 75 | unsigned char digest[16]; /* actual digest after Md5Final call */ 76 | } SDLTest_Md5Context; 77 | 78 | /* ---------- Function Prototypes ------------- */ 79 | 80 | /** 81 | * \brief initialize the context 82 | * 83 | * \param mdContext pointer to context variable 84 | * 85 | * Note: The function initializes the message-digest context 86 | * mdContext. Call before each new use of the context - 87 | * all fields are set to zero. 88 | */ 89 | void SDLTest_Md5Init(SDLTest_Md5Context * mdContext); 90 | 91 | 92 | /** 93 | * \brief update digest from variable length data 94 | * 95 | * \param mdContext pointer to context variable 96 | * \param inBuf pointer to data array/string 97 | * \param inLen length of data array/string 98 | * 99 | * Note: The function updates the message-digest context to account 100 | * for the presence of each of the characters inBuf[0..inLen-1] 101 | * in the message whose digest is being computed. 102 | */ 103 | 104 | void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, 105 | unsigned int inLen); 106 | 107 | 108 | /** 109 | * \brief complete digest computation 110 | * 111 | * \param mdContext pointer to context variable 112 | * 113 | * Note: The function terminates the message-digest computation and 114 | * ends with the desired message digest in mdContext.digest[0..15]. 115 | * Always call before using the digest[] variable. 116 | */ 117 | 118 | void SDLTest_Md5Final(SDLTest_Md5Context * mdContext); 119 | 120 | 121 | /* Ends C function definitions when using C++ */ 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | #include "close_code.h" 126 | 127 | #endif /* SDL_test_md5_h_ */ 128 | 129 | /* vi: set ts=4 sw=4 expandtab: */ 130 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_test_harness.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_harness.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | Defines types for test case definitions and the test execution harness API. 32 | 33 | Based on original GSOC code by Markus Kauppila 34 | */ 35 | 36 | #ifndef SDL_test_h_arness_h 37 | #define SDL_test_h_arness_h 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | 46 | /* ! Definitions for test case structures */ 47 | #define TEST_ENABLED 1 48 | #define TEST_DISABLED 0 49 | 50 | /* ! Definition of all the possible test return values of the test case method */ 51 | #define TEST_ABORTED -1 52 | #define TEST_STARTED 0 53 | #define TEST_COMPLETED 1 54 | #define TEST_SKIPPED 2 55 | 56 | /* ! Definition of all the possible test results for the harness */ 57 | #define TEST_RESULT_PASSED 0 58 | #define TEST_RESULT_FAILED 1 59 | #define TEST_RESULT_NO_ASSERT 2 60 | #define TEST_RESULT_SKIPPED 3 61 | #define TEST_RESULT_SETUP_FAILURE 4 62 | 63 | /* !< Function pointer to a test case setup function (run before every test) */ 64 | typedef void (*SDLTest_TestCaseSetUpFp)(void *arg); 65 | 66 | /* !< Function pointer to a test case function */ 67 | typedef int (*SDLTest_TestCaseFp)(void *arg); 68 | 69 | /* !< Function pointer to a test case teardown function (run after every test) */ 70 | typedef void (*SDLTest_TestCaseTearDownFp)(void *arg); 71 | 72 | /** 73 | * Holds information about a single test case. 74 | */ 75 | typedef struct SDLTest_TestCaseReference { 76 | /* !< Func2Stress */ 77 | SDLTest_TestCaseFp testCase; 78 | /* !< Short name (or function name) "Func2Stress" */ 79 | char *name; 80 | /* !< Long name or full description "This test pushes func2() to the limit." */ 81 | char *description; 82 | /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */ 83 | int enabled; 84 | } SDLTest_TestCaseReference; 85 | 86 | /** 87 | * Holds information about a test suite (multiple test cases). 88 | */ 89 | typedef struct SDLTest_TestSuiteReference { 90 | /* !< "PlatformSuite" */ 91 | char *name; 92 | /* !< The function that is run before each test. NULL skips. */ 93 | SDLTest_TestCaseSetUpFp testSetUp; 94 | /* !< The test cases that are run as part of the suite. Last item should be NULL. */ 95 | const SDLTest_TestCaseReference **testCases; 96 | /* !< The function that is run after each test. NULL skips. */ 97 | SDLTest_TestCaseTearDownFp testTearDown; 98 | } SDLTest_TestSuiteReference; 99 | 100 | 101 | /** 102 | * \brief Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z). 103 | * 104 | * Note: The returned string needs to be deallocated by the caller. 105 | * 106 | * \param length The length of the seed string to generate 107 | * 108 | * \returns the generated seed string 109 | */ 110 | char *SDLTest_GenerateRunSeed(const int length); 111 | 112 | /** 113 | * \brief Execute a test suite using the given run seed and execution key. 114 | * 115 | * \param testSuites Suites containing the test case. 116 | * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one. 117 | * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one. 118 | * \param filter Filter specification. NULL disables. Case sensitive. 119 | * \param testIterations Number of iterations to run each test case. 120 | * 121 | * \returns the test run result: 0 when all tests passed, 1 if any tests failed. 122 | */ 123 | int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations); 124 | 125 | 126 | /* Ends C function definitions when using C++ */ 127 | #ifdef __cplusplus 128 | } 129 | #endif 130 | #include "close_code.h" 131 | 132 | #endif /* SDL_test_h_arness_h */ 133 | 134 | /* vi: set ts=4 sw=4 expandtab: */ 135 | -------------------------------------------------------------------------------- /delayFrame/SDL/begin_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file begin_code.h 24 | * 25 | * This file sets things up for C dynamic library function definitions, 26 | * static inlined functions, and structures aligned at 4-byte alignment. 27 | * If you don't like ugly C preprocessor code, don't look at this file. :) 28 | */ 29 | 30 | /* This shouldn't be nested -- included it around code only. */ 31 | #ifdef _begin_code_h 32 | #error Nested inclusion of begin_code.h 33 | #endif 34 | #define _begin_code_h 35 | 36 | #ifndef SDL_DEPRECATED 37 | # if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ 38 | # define SDL_DEPRECATED __attribute__((deprecated)) 39 | # else 40 | # define SDL_DEPRECATED 41 | # endif 42 | #endif 43 | 44 | #ifndef SDL_UNUSED 45 | # ifdef __GNUC__ 46 | # define SDL_UNUSED __attribute__((unused)) 47 | # else 48 | # define SDL_UNUSED 49 | # endif 50 | #endif 51 | 52 | /* Some compilers use a special export keyword */ 53 | #ifndef DECLSPEC 54 | # if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) 55 | # ifdef DLL_EXPORT 56 | # define DECLSPEC __declspec(dllexport) 57 | # else 58 | # define DECLSPEC 59 | # endif 60 | # elif defined(__OS2__) 61 | # ifdef BUILD_SDL 62 | # define DECLSPEC __declspec(dllexport) 63 | # else 64 | # define DECLSPEC 65 | # endif 66 | # else 67 | # if defined(__GNUC__) && __GNUC__ >= 4 68 | # define DECLSPEC __attribute__ ((visibility("default"))) 69 | # else 70 | # define DECLSPEC 71 | # endif 72 | # endif 73 | #endif 74 | 75 | /* By default SDL uses the C calling convention */ 76 | #ifndef SDLCALL 77 | #if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__) 78 | #define SDLCALL __cdecl 79 | #elif defined(__OS2__) || defined(__EMX__) 80 | #define SDLCALL _System 81 | # if defined (__GNUC__) && !defined(_System) 82 | # define _System /* for old EMX/GCC compat. */ 83 | # endif 84 | #else 85 | #define SDLCALL 86 | #endif 87 | #endif /* SDLCALL */ 88 | 89 | /* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ 90 | #ifdef __SYMBIAN32__ 91 | #undef DECLSPEC 92 | #define DECLSPEC 93 | #endif /* __SYMBIAN32__ */ 94 | 95 | /* Force structure packing at 4 byte alignment. 96 | This is necessary if the header is included in code which has structure 97 | packing set to an alternate value, say for loading structures from disk. 98 | The packing is reset to the previous value in close_code.h 99 | */ 100 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 101 | #ifdef _MSC_VER 102 | #pragma warning(disable: 4103) 103 | #endif 104 | #ifdef __clang__ 105 | #pragma clang diagnostic ignored "-Wpragma-pack" 106 | #endif 107 | #ifdef __BORLANDC__ 108 | #pragma nopackwarning 109 | #endif 110 | #ifdef _M_X64 111 | /* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ 112 | #pragma pack(push,8) 113 | #else 114 | #pragma pack(push,4) 115 | #endif 116 | #endif /* Compiler needs structure packing set */ 117 | 118 | #ifndef SDL_INLINE 119 | #if defined(__GNUC__) 120 | #define SDL_INLINE __inline__ 121 | #elif defined(_MSC_VER) || defined(__BORLANDC__) || \ 122 | defined(__DMC__) || defined(__SC__) || \ 123 | defined(__WATCOMC__) || defined(__LCC__) || \ 124 | defined(__DECC) || defined(__CC_ARM) 125 | #define SDL_INLINE __inline 126 | #ifndef __inline__ 127 | #define __inline__ __inline 128 | #endif 129 | #else 130 | #define SDL_INLINE inline 131 | #ifndef __inline__ 132 | #define __inline__ inline 133 | #endif 134 | #endif 135 | #endif /* SDL_INLINE not defined */ 136 | 137 | #ifndef SDL_FORCE_INLINE 138 | #if defined(_MSC_VER) 139 | #define SDL_FORCE_INLINE __forceinline 140 | #elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) ) 141 | #define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__ 142 | #else 143 | #define SDL_FORCE_INLINE static SDL_INLINE 144 | #endif 145 | #endif /* SDL_FORCE_INLINE not defined */ 146 | 147 | #ifndef SDL_NORETURN 148 | #if defined(__GNUC__) 149 | #define SDL_NORETURN __attribute__((noreturn)) 150 | #elif defined(_MSC_VER) 151 | #define SDL_NORETURN __declspec(noreturn) 152 | #else 153 | #define SDL_NORETURN 154 | #endif 155 | #endif /* SDL_NORETURN not defined */ 156 | 157 | /* Apparently this is needed by several Windows compilers */ 158 | #if !defined(__MACH__) 159 | #ifndef NULL 160 | #ifdef __cplusplus 161 | #define NULL 0 162 | #else 163 | #define NULL ((void *)0) 164 | #endif 165 | #endif /* NULL */ 166 | #endif /* ! Mac OS X - breaks precompiled headers */ 167 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_error.h 24 | * 25 | * Simple error message routines for SDL. 26 | */ 27 | 28 | #ifndef SDL_error_h_ 29 | #define SDL_error_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Public functions */ 40 | 41 | 42 | /** 43 | * Set the SDL error message for the current thread. 44 | * 45 | * Calling this function will replace any previous error message that was set. 46 | * 47 | * This function always returns -1, since SDL frequently uses -1 to signify an 48 | * failing result, leading to this idiom: 49 | * 50 | * ```c 51 | * if (error_code) { 52 | * return SDL_SetError("This operation has failed: %d", error_code); 53 | * } 54 | * ``` 55 | * 56 | * \param fmt a printf()-style message format string 57 | * \param ... additional parameters matching % tokens in the `fmt` string, if 58 | * any 59 | * \returns always -1. 60 | * 61 | * \sa SDL_ClearError 62 | * \sa SDL_GetError 63 | */ 64 | extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 65 | 66 | /** 67 | * Retrieve a message about the last error that occurred on the current 68 | * thread. 69 | * 70 | * It is possible for multiple errors to occur before calling SDL_GetError(). 71 | * Only the last error is returned. 72 | * 73 | * The message is only applicable when an SDL function has signaled an error. 74 | * You must check the return values of SDL function calls to determine when to 75 | * appropriately call SDL_GetError(). You should _not_ use the results of 76 | * SDL_GetError() to decide if an error has occurred! Sometimes SDL will set 77 | * an error string even when reporting success. 78 | * 79 | * SDL will _not_ clear the error string for successful API calls. You _must_ 80 | * check return values for failure cases before you can assume the error 81 | * string applies. 82 | * 83 | * Error strings are set per-thread, so an error set in a different thread 84 | * will not interfere with the current thread's operation. 85 | * 86 | * The returned string is internally allocated and must not be freed by the 87 | * application. 88 | * 89 | * \returns a message with information about the specific error that occurred, 90 | * or an empty string if there hasn't been an error message set since 91 | * the last call to SDL_ClearError(). The message is only applicable 92 | * when an SDL function has signaled an error. You must check the 93 | * return values of SDL function calls to determine when to 94 | * appropriately call SDL_GetError(). 95 | * 96 | * \sa SDL_ClearError 97 | * \sa SDL_SetError 98 | */ 99 | extern DECLSPEC const char *SDLCALL SDL_GetError(void); 100 | 101 | /** 102 | * Get the last error message that was set for the current thread. 103 | * 104 | * This allows the caller to copy the error string into a provided buffer, but 105 | * otherwise operates exactly the same as SDL_GetError(). 106 | * 107 | * \param errstr A buffer to fill with the last error message that was set for 108 | * the current thread 109 | * \param maxlen The size of the buffer pointed to by the errstr parameter 110 | * \returns the pointer passed in as the `errstr` parameter. 111 | * 112 | * \sa SDL_GetError 113 | */ 114 | extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen); 115 | 116 | /** 117 | * Clear any previous error message for this thread. 118 | * 119 | * \sa SDL_GetError 120 | * \sa SDL_SetError 121 | */ 122 | extern DECLSPEC void SDLCALL SDL_ClearError(void); 123 | 124 | /** 125 | * \name Internal error functions 126 | * 127 | * \internal 128 | * Private error reporting function - used internally. 129 | */ 130 | /* @{ */ 131 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) 132 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) 133 | #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) 134 | typedef enum 135 | { 136 | SDL_ENOMEM, 137 | SDL_EFREAD, 138 | SDL_EFWRITE, 139 | SDL_EFSEEK, 140 | SDL_UNSUPPORTED, 141 | SDL_LASTERROR 142 | } SDL_errorcode; 143 | /* SDL_Error() unconditionally returns -1. */ 144 | extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); 145 | /* @} *//* Internal error functions */ 146 | 147 | /* Ends C function definitions when using C++ */ 148 | #ifdef __cplusplus 149 | } 150 | #endif 151 | #include "close_code.h" 152 | 153 | #endif /* SDL_error_h_ */ 154 | 155 | /* vi: set ts=4 sw=4 expandtab: */ 156 | -------------------------------------------------------------------------------- /scrsndcpy/Utility/CommonUtility.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "stdafx.h" 3 | #include "CommonUtility.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "Logger.h" 9 | #include "CodeConvert.h" 10 | 11 | /// 現在実行中の exeのあるフォルダのパスを返す 12 | fs::path GetExeDirectory() 13 | { 14 | WCHAR exePath[MAX_PATH] = L""; 15 | GetModuleFileName(NULL, exePath, MAX_PATH); 16 | fs::path exeFolder = exePath; 17 | return exeFolder.parent_path(); 18 | } 19 | 20 | 21 | void FatalErrorOccur(const std::string& error, const char* fileName, const int line) 22 | { 23 | ERROR_LOG << L"fileName: " << fileName << L" line: " << line << L"\n" << error; 24 | throw std::exception(error.c_str()); 25 | } 26 | 27 | void FatalErrorOccur(const std::wstring& error, const char* fileName, const int line) 28 | { 29 | ERROR_LOG << L"fileName: " << fileName << L" line: " << line << L"\n" << error; 30 | throw std::exception(CodeConvert::ShiftJISfromUTF16(error).c_str()); 31 | } 32 | 33 | /// プロセスを起動し、終了まで待つ 34 | DWORD StartProcess(const fs::path& exePath, const std::wstring& commandLine) 35 | { 36 | //INFO_LOG << L"StartProcess\n" << L"\"" << exePath << L"\" " << commandLine; 37 | 38 | STARTUPINFO startUpInfo = { sizeof(STARTUPINFO) }; 39 | startUpInfo.dwFlags = STARTF_USESHOWWINDOW; 40 | startUpInfo.wShowWindow = SW_HIDE; 41 | PROCESS_INFORMATION processInfo = {}; 42 | SECURITY_ATTRIBUTES securityAttributes = { sizeof(SECURITY_ATTRIBUTES) }; 43 | BOOL bRet = ::CreateProcess(exePath.native().c_str(), (LPWSTR)commandLine.data(), 44 | nullptr, nullptr, FALSE, 0, nullptr, nullptr, &startUpInfo, &processInfo); 45 | if (bRet == 0) { 46 | THROWEXCEPTION(L"StartProcess"); 47 | } 48 | //ATLASSERT(bRet); 49 | ::WaitForSingleObject(processInfo.hProcess, INFINITE); 50 | DWORD dwExitCode = 0; 51 | GetExitCodeProcess(processInfo.hProcess, &dwExitCode); 52 | 53 | ::CloseHandle(processInfo.hThread); 54 | ::CloseHandle(processInfo.hProcess); 55 | 56 | return dwExitCode; 57 | } 58 | 59 | DWORD StartProcessGetStdOut(const fs::path& exePath, const std::wstring& commandLine, std::string& stdoutText) 60 | { 61 | //INFO_LOG << L"StartProcessGetStdOut\n" << L"\"" << exePath << L"\" " << commandLine; 62 | 63 | try { 64 | CHandle hReadPipe; 65 | CHandle hWritePipe; 66 | if (!::CreatePipe(&hReadPipe.m_h, &hWritePipe.m_h, nullptr, 0)) 67 | throw std::runtime_error("CreatePipe failed"); 68 | 69 | CHandle hStdOutput; 70 | if (!::DuplicateHandle(GetCurrentProcess(), hWritePipe, GetCurrentProcess(), &hStdOutput.m_h, 0, TRUE, DUPLICATE_SAME_ACCESS)) 71 | throw std::runtime_error("DuplicateHandle failed"); 72 | 73 | hWritePipe.Close(); 74 | 75 | STARTUPINFO startUpInfo = { sizeof(STARTUPINFO) }; 76 | startUpInfo.dwFlags = STARTF_USESTDHANDLES; 77 | startUpInfo.hStdOutput = hStdOutput; 78 | startUpInfo.hStdError = hStdOutput; 79 | PROCESS_INFORMATION processInfo = {}; 80 | 81 | BOOL bRet = ::CreateProcess(exePath.c_str(), (LPWSTR)commandLine.data(), 82 | nullptr, nullptr, TRUE, 0, nullptr, nullptr, &startUpInfo, &processInfo); 83 | ATLASSERT(bRet); 84 | 85 | hStdOutput.Close(); 86 | 87 | std::string outresult; 88 | 89 | for (;;) { 90 | enum { kBufferSize = 512 }; 91 | char buffer[kBufferSize + 1] = ""; 92 | DWORD readSize = 0; 93 | bRet = ::ReadFile(hReadPipe, (LPVOID)buffer, kBufferSize, &readSize, nullptr); 94 | if (bRet && readSize == 0) { // EOF 95 | break; 96 | } 97 | 98 | if (bRet == 0) { 99 | DWORD err = ::GetLastError(); 100 | if (err == ERROR_BROKEN_PIPE) { 101 | break; 102 | } 103 | } 104 | outresult.append(buffer, readSize); 105 | } 106 | stdoutText = outresult; 107 | 108 | hReadPipe.Close(); 109 | 110 | DWORD dwExitCode = 0; 111 | GetExitCodeProcess(processInfo.hProcess, &dwExitCode); 112 | 113 | ::WaitForSingleObject(processInfo.hProcess, INFINITE); 114 | ::CloseHandle(processInfo.hThread); 115 | ::CloseHandle(processInfo.hProcess); 116 | 117 | return dwExitCode; 118 | } 119 | catch (std::exception& e) 120 | { 121 | THROWEXCEPTION(e.what()); 122 | return -1; 123 | } 124 | } 125 | 126 | fs::path SearchFirstFile(const fs::path& search) 127 | { 128 | WIN32_FIND_DATA fd = {}; 129 | HANDLE hFind = ::FindFirstFileW(search.c_str(), &fd); 130 | if (hFind == INVALID_HANDLE_VALUE) 131 | return L""; 132 | 133 | ::FindClose(hFind); 134 | 135 | fs::path firstFilePath = search.parent_path() / fd.cFileName; 136 | return firstFilePath; 137 | } 138 | 139 | 140 | std::string LoadFile(const fs::path& filePath) 141 | { 142 | std::ifstream fs(filePath.wstring(), std::ios::in | std::ios::binary); 143 | if (!fs) 144 | return ""; 145 | 146 | fs.seekg(0, std::ios::end); 147 | std::string buff; 148 | auto fileSize = fs.tellg(); 149 | buff.resize(fileSize); 150 | fs.seekg(std::ios::beg); 151 | fs.clear(); 152 | fs.read(const_cast(buff.data()), fileSize); 153 | return buff; 154 | } 155 | 156 | CComPtr LoadFileToMemoryStream(const fs::path& filePath) 157 | { 158 | std::ifstream fs(filePath.wstring(), std::ios::in | std::ios::binary); 159 | if (!fs) 160 | return nullptr; 161 | 162 | fs.seekg(0, std::ios::end); 163 | std::string buff; 164 | auto fileSize = fs.tellg(); 165 | buff.resize(fileSize); 166 | fs.seekg(std::ios::beg); 167 | fs.clear(); 168 | 169 | HGLOBAL hMem = ::GlobalAlloc(GMEM_FIXED, fileSize); 170 | if (!hMem) { 171 | return nullptr; 172 | } 173 | fs.read(static_cast(hMem), fileSize); 174 | 175 | CComPtr spStream; 176 | HRESULT hr = ::CreateStreamOnHGlobal(hMem, TRUE, &spStream); 177 | return spStream; 178 | } 179 | 180 | void SaveFile(const fs::path& filePath, const std::string& content) 181 | { 182 | std::ofstream fs(filePath.wstring(), std::ios::out | std::ios::binary); 183 | if (!fs) { 184 | THROWEXCEPTION("SaveFile open failed"); 185 | } 186 | fs.write(content.c_str(), content.length()); 187 | } 188 | 189 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_filesystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_filesystem.h 24 | * 25 | * \brief Include file for filesystem SDL API functions 26 | */ 27 | 28 | #ifndef SDL_filesystem_h_ 29 | #define SDL_filesystem_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * Get the directory where the application was run from. 42 | * 43 | * This is not necessarily a fast call, so you should call this once near 44 | * startup and save the string if you need it. 45 | * 46 | * **Mac OS X and iOS Specific Functionality**: If the application is in a 47 | * ".app" bundle, this function returns the Resource directory (e.g. 48 | * MyApp.app/Contents/Resources/). This behaviour can be overridden by adding 49 | * a property to the Info.plist file. Adding a string key with the name 50 | * SDL_FILESYSTEM_BASE_DIR_TYPE with a supported value will change the 51 | * behaviour. 52 | * 53 | * Supported values for the SDL_FILESYSTEM_BASE_DIR_TYPE property (Given an 54 | * application in /Applications/SDLApp/MyApp.app): 55 | * 56 | * - `resource`: bundle resource directory (the default). For example: 57 | * `/Applications/SDLApp/MyApp.app/Contents/Resources` 58 | * - `bundle`: the Bundle directory. Fpr example: 59 | * `/Applications/SDLApp/MyApp.app/` 60 | * - `parent`: the containing directory of the bundle. For example: 61 | * `/Applications/SDLApp/` 62 | * 63 | * The returned path is guaranteed to end with a path separator ('\' on 64 | * Windows, '/' on most other platforms). 65 | * 66 | * The pointer returned is owned by the caller. Please call SDL_free() on the 67 | * pointer when done with it. 68 | * 69 | * \returns an absolute path in UTF-8 encoding to the application data 70 | * directory. NULL will be returned on error or when the platform 71 | * doesn't implement this functionality, call SDL_GetError() for more 72 | * information. 73 | * 74 | * \since This function is available since SDL 2.0.1. 75 | * 76 | * \sa SDL_GetPrefPath 77 | */ 78 | extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); 79 | 80 | /** 81 | * Get the user-and-app-specific path where files can be written. 82 | * 83 | * Get the "pref dir". This is meant to be where users can write personal 84 | * files (preferences and save games, etc) that are specific to your 85 | * application. This directory is unique per user, per application. 86 | * 87 | * This function will decide the appropriate location in the native 88 | * filesystem, create the directory if necessary, and return a string of the 89 | * absolute path to the directory in UTF-8 encoding. 90 | * 91 | * On Windows, the string might look like: 92 | * 93 | * `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\` 94 | * 95 | * On Linux, the string might look like" 96 | * 97 | * `/home/bob/.local/share/My Program Name/` 98 | * 99 | * On Mac OS X, the string might look like: 100 | * 101 | * `/Users/bob/Library/Application Support/My Program Name/` 102 | * 103 | * You should assume the path returned by this function is the only safe place 104 | * to write files (and that SDL_GetBasePath(), while it might be writable, or 105 | * even the parent of the returned path, isn't where you should be writing 106 | * things). 107 | * 108 | * Both the org and app strings may become part of a directory name, so please 109 | * follow these rules: 110 | * 111 | * - Try to use the same org string (_including case-sensitivity_) for all 112 | * your applications that use this function. 113 | * - Always use a unique app string for each one, and make sure it never 114 | * changes for an app once you've decided on it. 115 | * - Unicode characters are legal, as long as it's UTF-8 encoded, but... 116 | * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game 117 | * Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. 118 | * 119 | * The returned path is guaranteed to end with a path separator ('\' on 120 | * Windows, '/' on most other platforms). 121 | * 122 | * The pointer returned is owned by the caller. Please call SDL_free() on the 123 | * pointer when done with it. 124 | * 125 | * \param org the name of your organization 126 | * \param app the name of your application 127 | * \returns a UTF-8 string of the user directory in platform-dependent 128 | * notation. NULL if there's a problem (creating directory failed, 129 | * etc.). 130 | * 131 | * \since This function is available since SDL 2.0.1. 132 | * 133 | * \sa SDL_GetBasePath 134 | */ 135 | extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); 136 | 137 | /* Ends C function definitions when using C++ */ 138 | #ifdef __cplusplus 139 | } 140 | #endif 141 | #include "close_code.h" 142 | 143 | #endif /* SDL_filesystem_h_ */ 144 | 145 | /* vi: set ts=4 sw=4 expandtab: */ 146 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_timer_h_ 23 | #define SDL_timer_h_ 24 | 25 | /** 26 | * \file SDL_timer.h 27 | * 28 | * Header for the SDL time management routines. 29 | */ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | #include "begin_code.h" 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * Get the number of milliseconds since SDL library initialization. 42 | * 43 | * This value wraps if the program runs for more than ~49 days. 44 | * 45 | * \returns an unsigned 32-bit value representing the number of milliseconds 46 | * since the SDL library initialized. 47 | * 48 | * \sa SDL_TICKS_PASSED 49 | */ 50 | extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); 51 | 52 | /** 53 | * Compare SDL ticks values, and return true if `A` has passed `B`. 54 | * 55 | * For example, if you want to wait 100 ms, you could do this: 56 | * 57 | * ```c++ 58 | * Uint32 timeout = SDL_GetTicks() + 100; 59 | * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { 60 | * // ... do work until timeout has elapsed 61 | * } 62 | * ``` 63 | */ 64 | #define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) 65 | 66 | /** 67 | * Get the current value of the high resolution counter. 68 | * 69 | * This function is typically used for profiling. 70 | * 71 | * The counter values are only meaningful relative to each other. Differences 72 | * between values can be converted to times by using 73 | * SDL_GetPerformanceFrequency(). 74 | * 75 | * \returns the current counter value. 76 | * 77 | * \sa SDL_GetPerformanceFrequency 78 | */ 79 | extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); 80 | 81 | /** 82 | * Get the count per second of the high resolution counter. 83 | * 84 | * \returns a platform-specific count per second. 85 | * 86 | * \since This function is available since SDL 2.0.0. 87 | * 88 | * \sa SDL_GetPerformanceCounter 89 | */ 90 | extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); 91 | 92 | /** 93 | * Wait a specified number of milliseconds before returning. 94 | * 95 | * This function waits a specified number of milliseconds before returning. It 96 | * waits at least the specified time, but possibly longer due to OS 97 | * scheduling. 98 | * 99 | * \param ms the number of milliseconds to delay 100 | */ 101 | extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); 102 | 103 | /** 104 | * Function prototype for the timer callback function. 105 | * 106 | * The callback function is passed the current timer interval and returns 107 | * the next timer interval. If the returned value is the same as the one 108 | * passed in, the periodic alarm continues, otherwise a new alarm is 109 | * scheduled. If the callback returns 0, the periodic alarm is cancelled. 110 | */ 111 | typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); 112 | 113 | /** 114 | * Definition of the timer ID type. 115 | */ 116 | typedef int SDL_TimerID; 117 | 118 | /** 119 | * Call a callback function at a future time. 120 | * 121 | * If you use this function, you must pass `SDL_INIT_TIMER` to SDL_Init(). 122 | * 123 | * The callback function is passed the current timer interval and the user 124 | * supplied parameter from the SDL_AddTimer() call and should return the next 125 | * timer interval. If the value returned from the callback is 0, the timer is 126 | * canceled. 127 | * 128 | * The callback is run on a separate thread. 129 | * 130 | * Timers take into account the amount of time it took to execute the 131 | * callback. For example, if the callback took 250 ms to execute and returned 132 | * 1000 (ms), the timer would only wait another 750 ms before its next 133 | * iteration. 134 | * 135 | * Timing may be inexact due to OS scheduling. Be sure to note the current 136 | * time with SDL_GetTicks() or SDL_GetPerformanceCounter() in case your 137 | * callback needs to adjust for variances. 138 | * 139 | * \param interval the timer delay, in milliseconds, passed to `callback` 140 | * \param callback the SDL_TimerCallback function to call when the specified 141 | * `interval` elapses 142 | * \param param a pointer that is passed to `callback` 143 | * \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more 144 | * information. 145 | * 146 | * \sa SDL_RemoveTimer 147 | */ 148 | extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, 149 | SDL_TimerCallback callback, 150 | void *param); 151 | 152 | /** 153 | * Remove a timer created with SDL_AddTimer(). 154 | * 155 | * \param id the ID of the timer to remove 156 | * \returns SDL_TRUE if the timer is removed or SDL_FALSE if the timer wasn't 157 | * found. 158 | * 159 | * \sa SDL_AddTimer 160 | */ 161 | extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); 162 | 163 | 164 | /* Ends C function definitions when using C++ */ 165 | #ifdef __cplusplus 166 | } 167 | #endif 168 | #include "close_code.h" 169 | 170 | #endif /* SDL_timer_h_ */ 171 | 172 | /* vi: set ts=4 sw=4 expandtab: */ 173 | -------------------------------------------------------------------------------- /scrsndcpy/TesseractWrapper.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "TesseractWrapper.h" 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | #include "Utility\Logger.h" 14 | #include "Utility\CodeConvert.h" 15 | #include "Utility\timer.h" 16 | 17 | using namespace CodeConvert; 18 | 19 | namespace TesseractWrapper { 20 | 21 | std::unordered_map> s_threadTess; 22 | std::unordered_map> s_threadTessBest; 23 | std::mutex s_mtx; 24 | 25 | //std::vector> s_cacheOCRFunction; 26 | 27 | 28 | bool TesseractInit() 29 | { 30 | return true; 31 | } 32 | 33 | void TesseractTerm() 34 | { 35 | std::unique_lock lock(s_mtx); 36 | s_threadTess.clear(); 37 | s_threadTessBest.clear(); 38 | 39 | //s_cacheOCRFunction.clear(); 40 | } 41 | #if 0 42 | std::shared_ptr GetOCRFunction() 43 | { 44 | std::unique_lock lock(s_mtx); 45 | // キャッシュを返す 46 | for (auto& cacheFunc : s_cacheOCRFunction) { 47 | if (cacheFunc.unique()) { 48 | return cacheFunc; 49 | } 50 | } 51 | 52 | // 新たに作成して返す 53 | 54 | // tesseract init 55 | auto ptess = std::make_shared(); 56 | 57 | auto dbFolderPath = GetExeDirectory() / L"tessdata"; 58 | if (ptess->Init(dbFolderPath.string().c_str(), "jpn")) { 59 | ERROR_LOG << L"Could not initialize tesseract."; 60 | ATLASSERT(FALSE); 61 | throw std::runtime_error("Could not initialize tesseract."); 62 | } 63 | INFO_LOG << L"ptess->Init success!"; 64 | ptess->SetPageSegMode(tesseract::/*PSM_SINGLE_BLOCK*/PSM_SINGLE_LINE); 65 | 66 | // OCR関数作成 67 | auto OCRFunc = std::make_shared([ptess](cv::Mat targetImage) -> std::wstring { 68 | Utility::timer timer; 69 | 70 | ptess->SetImage((uchar*)targetImage.data, targetImage.size().width, targetImage.size().height, targetImage.channels(), targetImage.step); 71 | 72 | ptess->Recognize(0); 73 | std::wstring text = UTF16fromUTF8(ptess->GetUTF8Text()).c_str(); 74 | 75 | // whilte space を取り除く 76 | boost::algorithm::trim(text); 77 | boost::algorithm::replace_all(text, L" ", L""); 78 | boost::algorithm::replace_all(text, L"\n", L""); 79 | 80 | INFO_LOG << L"TextFromImage result: [" << text << L"] processing time: " << UTF16fromUTF8(timer.format()); 81 | return text; 82 | }); 83 | 84 | s_cacheOCRFunction.emplace_back(OCRFunc); 85 | lock.unlock(); 86 | return OCRFunc; 87 | } 88 | #endif 89 | 90 | std::wstring TextFromImage(const std::wstring& targetImagePath) 91 | { 92 | //INFO_LOG << L"TextFromImage start"; 93 | Utility::timer timer; 94 | 95 | std::unique_lock lock(s_mtx); 96 | auto& ptess = s_threadTess[::GetCurrentThreadId()]; 97 | if (!ptess) { 98 | INFO_LOG << L"new tesseract::TessBaseAPI"; 99 | ptess.reset(new tesseract::TessBaseAPI); 100 | auto dbFolderPath = GetExeDirectory() / L"tessdata"; 101 | if (ptess->Init(dbFolderPath.string().c_str(), "jpn")) { 102 | ERROR_LOG << L"Could not initialize tesseract."; 103 | ATLASSERT(FALSE); 104 | return L""; 105 | } 106 | INFO_LOG << L"ptess->Init success!"; 107 | //ptess->SetPageSegMode(tesseract::/*PSM_SINGLE_BLOCK*/PSM_SINGLE_LINE); 108 | } 109 | lock.unlock(); 110 | 111 | Pix* image = pixRead(ShiftJISfromUTF16(targetImagePath).c_str()); 112 | if (!image) { 113 | ATLASSERT(FALSE); 114 | return L""; 115 | } 116 | ptess->SetImage(image); 117 | //ptess->SetImage((uchar*)targetImage.data, targetImage.size().width, targetImage.size().height, targetImage.channels(), targetImage.step); 118 | 119 | ptess->Recognize(0); 120 | if (false) { 121 | tesseract::ResultIterator* ri = ptess->GetIterator(); 122 | tesseract::PageIteratorLevel level = tesseract::RIL_TEXTLINE; 123 | if (ri != 0) { 124 | do { 125 | const char* word = ri->GetUTF8Text(level); 126 | float conf = ri->Confidence(level); 127 | int x1, y1, x2, y2; 128 | ri->BoundingBox(level, &x1, &y1, &x2, &y2); 129 | //printf("word: '%s'; \tconf: %.2f; BoundingBox: %d,%d,%d,%d;\n", 130 | //word, conf, x1, y1, x2, y2); 131 | delete[] word; 132 | } while (ri->Next(level)); 133 | } 134 | } 135 | std::wstring text = UTF16fromUTF8(ptess->GetUTF8Text()).c_str(); 136 | 137 | pixDestroy(&image); 138 | 139 | // whilte space を取り除く 140 | boost::algorithm::trim(text); 141 | boost::algorithm::replace_all(text, L" ", L""); 142 | boost::algorithm::replace_all(text, L"\n", L""); 143 | 144 | INFO_LOG << L"TextFromImage result: [" << text << L"] processing time: " << UTF16fromUTF8(timer.format()); 145 | return text; 146 | } 147 | #if 0 148 | std::wstring TextFromImageBest(cv::Mat targetImage) 149 | { 150 | INFO_LOG << L"TextFromImageBest start"; 151 | Utility::timer timer; 152 | 153 | std::unique_lock lock(s_mtx); 154 | auto& ptess = s_threadTessBest[::GetCurrentThreadId()]; 155 | if (!ptess) { 156 | INFO_LOG << L"new tesseract::TessBaseAPI"; 157 | ptess.reset(new tesseract::TessBaseAPI); 158 | auto dbFolderPath = GetExeDirectory() / L"tessdata" / L"best"; 159 | if (ptess->Init(dbFolderPath.string().c_str(), "jpn")) { 160 | ERROR_LOG << L"Could not initialize tesseract."; 161 | ATLASSERT(FALSE); 162 | return L""; 163 | } 164 | INFO_LOG << L"ptess->Init success!"; 165 | ptess->SetPageSegMode(tesseract::/*PSM_SINGLE_BLOCK*/PSM_SINGLE_LINE); 166 | } 167 | lock.unlock(); 168 | 169 | ptess->SetImage((uchar*)targetImage.data, targetImage.size().width, targetImage.size().height, targetImage.channels(), targetImage.step); 170 | 171 | ptess->Recognize(0); 172 | std::wstring text = UTF16fromUTF8(ptess->GetUTF8Text()).c_str(); 173 | 174 | // whilte space を取り除く 175 | boost::algorithm::trim(text); 176 | boost::algorithm::replace_all(text, L" ", L""); 177 | boost::algorithm::replace_all(text, L"\n", L""); 178 | 179 | INFO_LOG << L"TextFromImageBest result: [" << text << L"] processing time: " << UTF16fromUTF8(timer.format()); 180 | return text; 181 | } 182 | #endif 183 | } // namespace TesseractWrapper 184 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_shape.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_shape_h_ 23 | #define SDL_shape_h_ 24 | 25 | #include "SDL_stdinc.h" 26 | #include "SDL_pixels.h" 27 | #include "SDL_rect.h" 28 | #include "SDL_surface.h" 29 | #include "SDL_video.h" 30 | 31 | #include "begin_code.h" 32 | /* Set up for C function definitions, even when using C++ */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /** \file SDL_shape.h 38 | * 39 | * Header file for the shaped window API. 40 | */ 41 | 42 | #define SDL_NONSHAPEABLE_WINDOW -1 43 | #define SDL_INVALID_SHAPE_ARGUMENT -2 44 | #define SDL_WINDOW_LACKS_SHAPE -3 45 | 46 | /** 47 | * Create a window that can be shaped with the specified position, dimensions, 48 | * and flags. 49 | * 50 | * \param title The title of the window, in UTF-8 encoding. 51 | * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or 52 | * ::SDL_WINDOWPOS_UNDEFINED. 53 | * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or 54 | * ::SDL_WINDOWPOS_UNDEFINED. 55 | * \param w The width of the window. 56 | * \param h The height of the window. 57 | * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with 58 | * any of the following: ::SDL_WINDOW_OPENGL, 59 | * ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN, 60 | * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, 61 | * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set, 62 | * and ::SDL_WINDOW_FULLSCREEN is always unset. 63 | * \return the window created, or NULL if window creation failed. 64 | * 65 | * \sa SDL_DestroyWindow 66 | */ 67 | extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); 68 | 69 | /** 70 | * Return whether the given window is a shaped window. 71 | * 72 | * \param window The window to query for being shaped. 73 | * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if 74 | * the window is unshaped or NULL. 75 | * 76 | * \sa SDL_CreateShapedWindow 77 | */ 78 | extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window); 79 | 80 | /** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */ 81 | typedef enum { 82 | /** \brief The default mode, a binarized alpha cutoff of 1. */ 83 | ShapeModeDefault, 84 | /** \brief A binarized alpha cutoff with a given integer value. */ 85 | ShapeModeBinarizeAlpha, 86 | /** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */ 87 | ShapeModeReverseBinarizeAlpha, 88 | /** \brief A color key is applied. */ 89 | ShapeModeColorKey 90 | } WindowShapeMode; 91 | 92 | #define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha) 93 | 94 | /** \brief A union containing parameters for shaped windows. */ 95 | typedef union { 96 | /** \brief A cutoff alpha value for binarization of the window shape's alpha channel. */ 97 | Uint8 binarizationCutoff; 98 | SDL_Color colorKey; 99 | } SDL_WindowShapeParams; 100 | 101 | /** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */ 102 | typedef struct SDL_WindowShapeMode { 103 | /** \brief The mode of these window-shape parameters. */ 104 | WindowShapeMode mode; 105 | /** \brief Window-shape parameters. */ 106 | SDL_WindowShapeParams parameters; 107 | } SDL_WindowShapeMode; 108 | 109 | /** 110 | * Set the shape and parameters of a shaped window. 111 | * 112 | * \param window The shaped window whose parameters should be set. 113 | * \param shape A surface encoding the desired shape for the window. 114 | * \param shape_mode The parameters to set for the shaped window. 115 | * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape 116 | * argument, or SDL_NONSHAPEABLE_WINDOW if the SDL_Window given does 117 | * not reference a valid shaped window. 118 | * 119 | * \sa SDL_WindowShapeMode 120 | * \sa SDL_GetShapedWindowMode 121 | */ 122 | extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); 123 | 124 | /** 125 | * Get the shape parameters of a shaped window. 126 | * 127 | * \param window The shaped window whose parameters should be retrieved. 128 | * \param shape_mode An empty shape-mode structure to fill, or NULL to check 129 | * whether the window has a shape. 130 | * \return 0 if the window has a shape and, provided shape_mode was not NULL, 131 | * shape_mode has been filled with the mode data, 132 | * SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped 133 | * window, or SDL_WINDOW_LACKS_SHAPE if the SDL_Window given is a 134 | * shapeable window currently lacking a shape. 135 | * 136 | * \sa SDL_WindowShapeMode 137 | * \sa SDL_SetWindowShape 138 | */ 139 | extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode); 140 | 141 | /* Ends C function definitions when using C++ */ 142 | #ifdef __cplusplus 143 | } 144 | #endif 145 | #include "close_code.h" 146 | 147 | #endif /* SDL_shape_h_ */ 148 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_main.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_main_h_ 23 | #define SDL_main_h_ 24 | 25 | #include "SDL_stdinc.h" 26 | 27 | /** 28 | * \file SDL_main.h 29 | * 30 | * Redefine main() on some platforms so that it is called by SDL. 31 | */ 32 | 33 | #ifndef SDL_MAIN_HANDLED 34 | #if defined(__WIN32__) 35 | /* On Windows SDL provides WinMain(), which parses the command line and passes 36 | the arguments to your main function. 37 | 38 | If you provide your own WinMain(), you may define SDL_MAIN_HANDLED 39 | */ 40 | #define SDL_MAIN_AVAILABLE 41 | 42 | #elif defined(__WINRT__) 43 | /* On WinRT, SDL provides a main function that initializes CoreApplication, 44 | creating an instance of IFrameworkView in the process. 45 | 46 | Please note that #include'ing SDL_main.h is not enough to get a main() 47 | function working. In non-XAML apps, the file, 48 | src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled 49 | into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be 50 | called, with a pointer to the Direct3D-hosted XAML control passed in. 51 | */ 52 | #define SDL_MAIN_NEEDED 53 | 54 | #elif defined(__IPHONEOS__) 55 | /* On iOS SDL provides a main function that creates an application delegate 56 | and starts the iOS application run loop. 57 | 58 | If you link with SDL dynamically on iOS, the main function can't be in a 59 | shared library, so you need to link with libSDLmain.a, which includes a 60 | stub main function that calls into the shared library to start execution. 61 | 62 | See src/video/uikit/SDL_uikitappdelegate.m for more details. 63 | */ 64 | #define SDL_MAIN_NEEDED 65 | 66 | #elif defined(__ANDROID__) 67 | /* On Android SDL provides a Java class in SDLActivity.java that is the 68 | main activity entry point. 69 | 70 | See docs/README-android.md for more details on extending that class. 71 | */ 72 | #define SDL_MAIN_NEEDED 73 | 74 | /* We need to export SDL_main so it can be launched from Java */ 75 | #define SDLMAIN_DECLSPEC DECLSPEC 76 | 77 | #elif defined(__NACL__) 78 | /* On NACL we use ppapi_simple to set up the application helper code, 79 | then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before 80 | starting the user main function. 81 | All user code is run in a separate thread by ppapi_simple, thus 82 | allowing for blocking io to take place via nacl_io 83 | */ 84 | #define SDL_MAIN_NEEDED 85 | 86 | #endif 87 | #endif /* SDL_MAIN_HANDLED */ 88 | 89 | #ifndef SDLMAIN_DECLSPEC 90 | #define SDLMAIN_DECLSPEC 91 | #endif 92 | 93 | /** 94 | * \file SDL_main.h 95 | * 96 | * The application's main() function must be called with C linkage, 97 | * and should be declared like this: 98 | * \code 99 | * #ifdef __cplusplus 100 | * extern "C" 101 | * #endif 102 | * int main(int argc, char *argv[]) 103 | * { 104 | * } 105 | * \endcode 106 | */ 107 | 108 | #if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) 109 | #define main SDL_main 110 | #endif 111 | 112 | #include "begin_code.h" 113 | #ifdef __cplusplus 114 | extern "C" { 115 | #endif 116 | 117 | /** 118 | * The prototype for the application's main() function 119 | */ 120 | typedef int (*SDL_main_func)(int argc, char *argv[]); 121 | extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]); 122 | 123 | 124 | /** 125 | * Circumvent failure of SDL_Init() when not using SDL_main() as an entry 126 | * point. 127 | * 128 | * This function is defined in SDL_main.h, along with the preprocessor rule to 129 | * redefine main() as SDL_main(). Thus to ensure that your main() function 130 | * will not be changed it is necessary to define SDL_MAIN_HANDLED before 131 | * including SDL.h. 132 | * 133 | * \sa SDL_Init 134 | */ 135 | extern DECLSPEC void SDLCALL SDL_SetMainReady(void); 136 | 137 | #ifdef __WIN32__ 138 | 139 | /** 140 | * This can be called to set the application class at startup 141 | */ 142 | extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); 143 | extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); 144 | 145 | #endif /* __WIN32__ */ 146 | 147 | 148 | #ifdef __WINRT__ 149 | 150 | /** 151 | * Initialize and launch an SDL/WinRT application. 152 | * 153 | * \param mainFunction the SDL app's C-style main(), an SDL_main_func 154 | * \param reserved reserved for future use; should be NULL 155 | * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve 156 | * more information on the failure. 157 | * 158 | * \since This function is available since SDL 2.0.3. 159 | */ 160 | extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved); 161 | 162 | #endif /* __WINRT__ */ 163 | 164 | #if defined(__IPHONEOS__) 165 | 166 | /** 167 | * Initializes and launches an SDL application. 168 | * 169 | * \param argc The argc parameter from the application's main() function 170 | * \param argv The argv parameter from the application's main() function 171 | * \param mainFunction The SDL app's C-style main(), an SDL_main_func 172 | * \return the return value from mainFunction 173 | */ 174 | extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction); 175 | 176 | #endif /* __IPHONEOS__ */ 177 | 178 | 179 | #ifdef __cplusplus 180 | } 181 | #endif 182 | #include "close_code.h" 183 | 184 | #endif /* SDL_main_h_ */ 185 | 186 | /* vi: set ts=4 sw=4 expandtab: */ 187 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_version.h 24 | * 25 | * This header defines the current SDL version. 26 | */ 27 | 28 | #ifndef SDL_version_h_ 29 | #define SDL_version_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * Information about the version of SDL in use. 41 | * 42 | * Represents the library's version as three levels: major revision 43 | * (increments with massive changes, additions, and enhancements), 44 | * minor revision (increments with backwards-compatible changes to the 45 | * major revision), and patchlevel (increments with fixes to the minor 46 | * revision). 47 | * 48 | * \sa SDL_VERSION 49 | * \sa SDL_GetVersion 50 | */ 51 | typedef struct SDL_version 52 | { 53 | Uint8 major; /**< major version */ 54 | Uint8 minor; /**< minor version */ 55 | Uint8 patch; /**< update version */ 56 | } SDL_version; 57 | 58 | /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL 59 | */ 60 | #define SDL_MAJOR_VERSION 2 61 | #define SDL_MINOR_VERSION 0 62 | #define SDL_PATCHLEVEL 16 63 | 64 | /** 65 | * Macro to determine SDL version program was compiled against. 66 | * 67 | * This macro fills in a SDL_version structure with the version of the 68 | * library you compiled against. This is determined by what header the 69 | * compiler uses. Note that if you dynamically linked the library, you might 70 | * have a slightly newer or older version at runtime. That version can be 71 | * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), 72 | * is not a macro. 73 | * 74 | * \param x A pointer to a SDL_version struct to initialize. 75 | * 76 | * \sa SDL_version 77 | * \sa SDL_GetVersion 78 | */ 79 | #define SDL_VERSION(x) \ 80 | { \ 81 | (x)->major = SDL_MAJOR_VERSION; \ 82 | (x)->minor = SDL_MINOR_VERSION; \ 83 | (x)->patch = SDL_PATCHLEVEL; \ 84 | } 85 | 86 | /** 87 | * This macro turns the version numbers into a numeric value: 88 | * \verbatim 89 | (1,2,3) -> (1203) 90 | \endverbatim 91 | * 92 | * This assumes that there will never be more than 100 patchlevels. 93 | */ 94 | #define SDL_VERSIONNUM(X, Y, Z) \ 95 | ((X)*1000 + (Y)*100 + (Z)) 96 | 97 | /** 98 | * This is the version number macro for the current SDL version. 99 | */ 100 | #define SDL_COMPILEDVERSION \ 101 | SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) 102 | 103 | /** 104 | * This macro will evaluate to true if compiled with SDL at least X.Y.Z. 105 | */ 106 | #define SDL_VERSION_ATLEAST(X, Y, Z) \ 107 | (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) 108 | 109 | /** 110 | * Get the version of SDL that is linked against your program. 111 | * 112 | * If you are linking to SDL dynamically, then it is possible that the current 113 | * version will be different than the version you compiled against. This 114 | * function returns the current version, while SDL_VERSION() is a macro that 115 | * tells you what version you compiled with. 116 | * 117 | * This function may be called safely at any time, even before SDL_Init(). 118 | * 119 | * \param ver the SDL_version structure that contains the version information 120 | * 121 | * \sa SDL_GetRevision 122 | */ 123 | extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); 124 | 125 | /** 126 | * Get the code revision of SDL that is linked against your program. 127 | * 128 | * This value is the revision of the code you are linked with and may be 129 | * different from the code you are compiling with, which is found in the 130 | * constant SDL_REVISION. 131 | * 132 | * The revision is arbitrary string (a hash value) uniquely identifying the 133 | * exact revision of the SDL library in use, and is only useful in comparing 134 | * against other revisions. It is NOT an incrementing number. 135 | * 136 | * If SDL wasn't built from a git repository with the appropriate tools, this 137 | * will return an empty string. 138 | * 139 | * Prior to SDL 2.0.16, before development moved to GitHub, this returned a 140 | * hash for a Mercurial repository. 141 | * 142 | * You shouldn't use this function for anything but logging it for debugging 143 | * purposes. The string is not intended to be reliable in any way. 144 | * 145 | * \returns an arbitrary string, uniquely identifying the exact revision of 146 | * the SDL library in use. 147 | * 148 | * \sa SDL_GetVersion 149 | */ 150 | extern DECLSPEC const char *SDLCALL SDL_GetRevision(void); 151 | 152 | /** 153 | * Obsolete function, do not use. 154 | * 155 | * When SDL was hosted in a Mercurial repository, and was built carefully, 156 | * this would return the revision number that the build was created from. 157 | * This number was not reliable for several reasons, but more importantly, 158 | * SDL is now hosted in a git repository, which does not offer numbers at 159 | * all, only hashes. This function only ever returns zero now. Don't use it. 160 | */ 161 | extern SDL_DEPRECATED DECLSPEC int SDLCALL SDL_GetRevisionNumber(void); 162 | 163 | 164 | /* Ends C function definitions when using C++ */ 165 | #ifdef __cplusplus 166 | } 167 | #endif 168 | #include "close_code.h" 169 | 170 | #endif /* SDL_version_h_ */ 171 | 172 | /* vi: set ts=4 sw=4 expandtab: */ 173 | -------------------------------------------------------------------------------- /delayFrame/SDL/SDL_config_macosx.h.orig: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | 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 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_macosx_h_ 23 | #define SDL_config_macosx_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | /* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ 29 | #include 30 | 31 | /* This is a set of defines to configure the SDL features */ 32 | 33 | #ifdef __LP64__ 34 | #define SIZEOF_VOIDP 8 35 | #else 36 | #define SIZEOF_VOIDP 4 37 | #endif 38 | 39 | /* Useful headers */ 40 | #define HAVE_ALLOCA_H 1 41 | #define HAVE_SYS_TYPES_H 1 42 | #define HAVE_STDIO_H 1 43 | #define STDC_HEADERS 1 44 | #define HAVE_STRING_H 1 45 | #define HAVE_INTTYPES_H 1 46 | #define HAVE_STDINT_H 1 47 | #define HAVE_CTYPE_H 1 48 | #define HAVE_MATH_H 1 49 | #define HAVE_SIGNAL_H 1 50 | 51 | /* C library functions */ 52 | #define HAVE_MALLOC 1 53 | #define HAVE_CALLOC 1 54 | #define HAVE_REALLOC 1 55 | #define HAVE_FREE 1 56 | #define HAVE_ALLOCA 1 57 | #define HAVE_GETENV 1 58 | #define HAVE_SETENV 1 59 | #define HAVE_PUTENV 1 60 | #define HAVE_UNSETENV 1 61 | #define HAVE_QSORT 1 62 | #define HAVE_ABS 1 63 | #define HAVE_BCOPY 1 64 | #define HAVE_MEMSET 1 65 | #define HAVE_MEMCPY 1 66 | #define HAVE_MEMMOVE 1 67 | #define HAVE_MEMCMP 1 68 | #define HAVE_STRLEN 1 69 | #define HAVE_STRLCPY 1 70 | #define HAVE_STRLCAT 1 71 | #define HAVE_STRDUP 1 72 | #define HAVE_STRCHR 1 73 | #define HAVE_STRRCHR 1 74 | #define HAVE_STRSTR 1 75 | #define HAVE_STRTOL 1 76 | #define HAVE_STRTOUL 1 77 | #define HAVE_STRTOLL 1 78 | #define HAVE_STRTOULL 1 79 | #define HAVE_STRTOD 1 80 | #define HAVE_ATOI 1 81 | #define HAVE_ATOF 1 82 | #define HAVE_STRCMP 1 83 | #define HAVE_STRNCMP 1 84 | #define HAVE_STRCASECMP 1 85 | #define HAVE_STRNCASECMP 1 86 | #define HAVE_VSSCANF 1 87 | #define HAVE_VSNPRINTF 1 88 | #define HAVE_CEIL 1 89 | #define HAVE_COPYSIGN 1 90 | #define HAVE_COS 1 91 | #define HAVE_COSF 1 92 | #define HAVE_FABS 1 93 | #define HAVE_FLOOR 1 94 | #define HAVE_LOG 1 95 | #define HAVE_POW 1 96 | #define HAVE_SCALBN 1 97 | #define HAVE_SIN 1 98 | #define HAVE_SINF 1 99 | #define HAVE_SQRT 1 100 | #define HAVE_SQRTF 1 101 | #define HAVE_TAN 1 102 | #define HAVE_TANF 1 103 | #define HAVE_SIGACTION 1 104 | #define HAVE_SETJMP 1 105 | #define HAVE_NANOSLEEP 1 106 | #define HAVE_SYSCONF 1 107 | #define HAVE_SYSCTLBYNAME 1 108 | #define HAVE_ATAN 1 109 | #define HAVE_ATAN2 1 110 | #define HAVE_ACOS 1 111 | #define HAVE_ASIN 1 112 | 113 | /* Enable various audio drivers */ 114 | #define SDL_AUDIO_DRIVER_COREAUDIO 1 115 | #define SDL_AUDIO_DRIVER_DISK 1 116 | #define SDL_AUDIO_DRIVER_DUMMY 1 117 | 118 | /* Enable various input drivers */ 119 | #define SDL_JOYSTICK_IOKIT 1 120 | #define SDL_HAPTIC_IOKIT 1 121 | 122 | /* Enable various shared object loading systems */ 123 | #define SDL_LOADSO_DLOPEN 1 124 | 125 | /* Enable various threading systems */ 126 | #define SDL_THREAD_PTHREAD 1 127 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 128 | 129 | /* Enable various timer systems */ 130 | #define SDL_TIMER_UNIX 1 131 | 132 | /* Enable various video drivers */ 133 | #define SDL_VIDEO_DRIVER_COCOA 1 134 | #define SDL_VIDEO_DRIVER_DUMMY 1 135 | #undef SDL_VIDEO_DRIVER_X11 136 | #define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" 137 | #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" 138 | #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib" 139 | #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/usr/X11R6/lib/libXi.6.dylib" 140 | #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" 141 | #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib" 142 | #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib" 143 | #define SDL_VIDEO_DRIVER_X11_XDBE 1 144 | #define SDL_VIDEO_DRIVER_X11_XINERAMA 1 145 | #define SDL_VIDEO_DRIVER_X11_XRANDR 1 146 | #define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 147 | #define SDL_VIDEO_DRIVER_X11_XSHAPE 1 148 | #define SDL_VIDEO_DRIVER_X11_XVIDMODE 1 149 | #define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1 150 | 151 | #ifdef MAC_OS_X_VERSION_10_8 152 | /* 153 | * No matter the versions targeted, this is the 10.8 or later SDK, so you have 154 | * to use the external Xquartz, which is a more modern Xlib. Previous SDKs 155 | * used an older Xlib. 156 | */ 157 | #define SDL_VIDEO_DRIVER_X11_XINPUT2 1 158 | #define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1 159 | #define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1 160 | #endif 161 | 162 | #ifndef SDL_VIDEO_RENDER_OGL 163 | #define SDL_VIDEO_RENDER_OGL 1 164 | #endif 165 | 166 | /* Enable OpenGL support */ 167 | #ifndef SDL_VIDEO_OPENGL 168 | #define SDL_VIDEO_OPENGL 1 169 | #endif 170 | #ifndef SDL_VIDEO_OPENGL_CGL 171 | #define SDL_VIDEO_OPENGL_CGL 1 172 | #endif 173 | #ifndef SDL_VIDEO_OPENGL_GLX 174 | #define SDL_VIDEO_OPENGL_GLX 1 175 | #endif 176 | 177 | /* Enable Vulkan support */ 178 | /* Metal/MoltenVK/Vulkan only supported on 64-bit architectures and 10.11+ */ 179 | #if TARGET_CPU_X86_64 180 | #define SDL_VIDEO_VULKAN 1 181 | #else 182 | #define SDL_VIDEO_VULKAN 0 183 | #endif 184 | 185 | /* Enable system power support */ 186 | #define SDL_POWER_MACOSX 1 187 | 188 | /* enable filesystem support */ 189 | #define SDL_FILESYSTEM_COCOA 1 190 | 191 | /* Enable assembly routines */ 192 | #define SDL_ASSEMBLY_ROUTINES 1 193 | #ifdef __ppc__ 194 | #define SDL_ALTIVEC_BLITTERS 1 195 | #endif 196 | 197 | #endif /* SDL_config_macosx_h_ */ 198 | --------------------------------------------------------------------------------