From 8e7cc3900045bf7fd0a98a7ac85fd26ef8bdb32b Mon Sep 17 00:00:00 2001 From: Karutoh Date: Wed, 24 Jul 2024 01:36:20 -0700 Subject: [PATCH] Added shared library support. --- CMakeLists.txt | 23 +++-- include/ehs/Base64.h | 10 +-- include/ehs/BaseObj.h | 2 +- include/ehs/Color3.h | 12 +-- include/ehs/Color4.h | 12 +-- include/ehs/Data.h | 2 +- include/ehs/DataType.h | 6 +- include/ehs/EHS.h | 36 ++++---- include/ehs/GC.h | 2 +- include/ehs/HRNG.h | 2 +- include/ehs/Log.h | 2 +- include/ehs/Mat2.h | 9 +- include/ehs/Mat3.h | 9 +- include/ehs/Mat4.h | 7 +- include/ehs/Math.h | 14 +-- include/ehs/PtrData.h | 6 +- include/ehs/Str.h | 47 ++++++---- include/ehs/Task.h | 2 +- include/ehs/Type.h | 2 +- include/ehs/URI.h | 2 +- include/ehs/UTF.h | 2 +- include/ehs/Util.h | 2 +- include/ehs/Version.h | 2 +- include/ehs/db/Database.h | 2 +- include/ehs/db/DbObject.h | 2 +- include/ehs/db/DbTable.h | 2 +- include/ehs/db/DbVar.h | 2 +- include/ehs/db/DbVarTmpl.h | 2 +- include/ehs/io/BaseDirectory.h | 2 +- include/ehs/io/BaseFile.h | 2 +- include/ehs/io/BaseFileMonitor.h | 2 +- include/ehs/io/BaseWindow.h | 2 +- include/ehs/io/COM.h | 2 +- include/ehs/io/Console.h | 2 +- include/ehs/io/Directory_LNX.h | 2 +- include/ehs/io/Directory_W32.h | 2 +- include/ehs/io/FileMonitor_UNX.h | 2 +- include/ehs/io/FileMonitor_W32.h | 2 +- include/ehs/io/File_UNX.h | 2 +- include/ehs/io/File_W32.h | 2 +- include/ehs/io/FontAtlas.h | 2 +- include/ehs/io/Glyph.h | 2 +- include/ehs/io/RIFF.h | 2 +- include/ehs/io/RIFF_Chunk.h | 2 +- include/ehs/io/Resource.h | 2 +- include/ehs/io/UsbBase.h | 2 +- include/ehs/io/Usb_LNX.h | 2 +- include/ehs/io/Window_W32.h | 9 +- include/ehs/io/Window_Way.h | 2 +- include/ehs/io/Window_XCB.h | 2 +- include/ehs/io/audio/Audio.h | 2 +- include/ehs/io/audio/AudioCodec.h | 2 +- include/ehs/io/audio/AudioDevice_ALSA.h | 2 +- include/ehs/io/audio/AudioDevice_W32.h | 2 +- include/ehs/io/audio/BaseAudioDevice.h | 2 +- include/ehs/io/hid/Button.h | 2 +- include/ehs/io/hid/ButtonState.h | 2 +- include/ehs/io/hid/HID.h | 2 +- include/ehs/io/hid/Input.h | 2 +- include/ehs/io/hid/InputHandler.h | 2 +- include/ehs/io/hid/Keyboard.h | 2 +- include/ehs/io/hid/Mouse.h | 2 +- include/ehs/io/img/Img.h | 2 +- include/ehs/io/img/ImgCodec.h | 2 +- include/ehs/io/img/PNG.h | 2 +- include/ehs/io/img/PNG_Chunk.h | 2 +- include/ehs/io/mdl/AnimBone.h | 2 +- include/ehs/io/mdl/Animation.h | 2 +- include/ehs/io/mdl/Bone.h | 2 +- include/ehs/io/mdl/KeyFrame.h | 2 +- include/ehs/io/mdl/Mdl.h | 2 +- include/ehs/io/mdl/MdlCodec.h | 2 +- include/ehs/io/mdl/Mesh.h | 2 +- include/ehs/io/mdl/PropertyChange.h | 2 +- include/ehs/io/socket/BaseDNS.h | 2 +- include/ehs/io/socket/BaseTCP.h | 2 +- include/ehs/io/socket/BaseUDP.h | 2 +- include/ehs/io/socket/DNS_LNX.h | 2 +- include/ehs/io/socket/DNS_W32.h | 2 +- include/ehs/io/socket/Request.h | 2 +- include/ehs/io/socket/Response.h | 2 +- include/ehs/io/socket/SSL.h | 2 +- include/ehs/io/socket/TCP_BSD.h | 2 +- include/ehs/io/socket/TCP_W32.h | 2 +- include/ehs/io/socket/UDP_BSD.h | 2 +- include/ehs/io/socket/UDP_W32.h | 2 +- include/ehs/io/socket/rest/Spotify.h | 2 +- include/ehs/io/socket/rest/Twitch.h | 2 +- include/ehs/io/socket/rest/TwitchChat.h | 2 +- include/ehs/json/Json.h | 2 +- include/ehs/json/JsonArray.h | 2 +- include/ehs/json/JsonBase.h | 2 +- include/ehs/json/JsonBool.h | 2 +- include/ehs/json/JsonNum.h | 2 +- include/ehs/json/JsonObj.h | 2 +- include/ehs/json/JsonStr.h | 2 +- include/ehs/json/JsonVar.h | 2 +- include/ehs/system/BaseMutex.h | 2 +- include/ehs/system/BaseOpen.h | 2 +- include/ehs/system/BaseSemaphore.h | 2 +- include/ehs/system/BaseSystem.h | 2 +- include/ehs/system/CPU.h | 2 +- include/ehs/system/FileSystem.h | 2 +- include/ehs/system/Mutex_PT.h | 2 +- include/ehs/system/Mutex_W32.h | 2 +- include/ehs/system/OS.h | 4 +- include/ehs/system/Open_UNX.h | 2 +- include/ehs/system/Open_W32.h | 21 ++--- include/ehs/system/Semaphore_P.h | 2 +- include/ehs/system/Semaphore_W32.h | 2 +- include/ehs/system/System_LNX.h | 2 +- include/ehs/system/System_W32.h | 2 +- include/ehs/system/Thread.h | 2 +- include/ehs/system/User.h | 2 +- src/Base64.cpp | 4 +- src/EHS.cpp | 115 ++++++++++++------------ src/StrToHash.cpp | 8 +- src/db/Database.cpp | 2 +- src/db/DbObject.cpp | 2 +- src/db/DbTable.cpp | 2 +- src/io/Directory_W32.cpp | 6 +- src/io/Window_W32.cpp | 34 ++----- 122 files changed, 298 insertions(+), 298 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4083317..4a571e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -239,11 +239,14 @@ endif() #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") #message("${CMAKE_CXX_FLAGS}") -add_library(EHS ${EHS_SOURCES}) - +add_library(EHS_STC STATIC ${EHS_SOURCES}) +add_library(EHS_DYN SHARED ${EHS_SOURCES}) add_executable(StrToHash src/StrToHash.cpp) -target_include_directories(EHS PUBLIC ${PROJECT_SOURCE_DIR}/include) +target_compile_definitions(EHS_DYN PRIVATE EHS_LIB_EXPORT) + +target_include_directories(EHS_STC PUBLIC ${PROJECT_SOURCE_DIR}/include) +target_include_directories(EHS_DYN PUBLIC ${PROJECT_SOURCE_DIR}/include) if (IS_OS_LINUX) set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/.local") @@ -251,12 +254,13 @@ elseif (IS_OS_WINDOWS) set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/EHS") endif () -install(TARGETS EHS DESTINATION lib) +install(TARGETS EHS_STC DESTINATION lib) +install(TARGETS EHS_DYN RUNTIME DESTINATION bin) +install(TARGETS EHS_DYN LIBRARY DESTINATION lib) +install(TARGETS StrToHash DESTINATION bin) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include) -install(TARGETS StrToHash DESTINATION bin) - find_package(ZLIB REQUIRED) if (ZLIB_FOUND) message(STATUS "ZLIB was found.") @@ -271,10 +275,11 @@ else () message(STATUS "OpenSSL was not found.") endif () -target_link_libraries(EHS OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB) +target_link_libraries(EHS_STC OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB) +target_link_libraries(EHS_DYN OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB avrt ws2_32) if (IS_OS_WINDOWS) - target_link_libraries(StrToHash ws2_32 avrt EHS) + target_link_libraries(StrToHash ws2_32 avrt EHS_STC) elseif (IS_OS_LINUX) if (LINUX_WINDOW_SYSTEM STREQUAL "Wayland") target_link_libraries(StrToHash wayland-client) @@ -282,5 +287,5 @@ elseif (IS_OS_LINUX) target_link_libraries(StrToHash xcb xcb-cursor xcb-xfixes xcb-xinput) endif () - target_link_libraries(StrToHash z asound EHS) + target_link_libraries(StrToHash z asound EHS_STC) endif () \ No newline at end of file diff --git a/include/ehs/Base64.h b/include/ehs/Base64.h index bbdb778..71fcf35 100644 --- a/include/ehs/Base64.h +++ b/include/ehs/Base64.h @@ -5,20 +5,20 @@ namespace ehs { - class Base64 + class EHS_LIB_IO Base64 { private: static const char ascii[]; public: - static Str_8 Encode(const Str_8 input); + static Str_8 Encode(const Str_8 &input); - static Str_8 Decode(const Str_8 input); + static Str_8 Decode(const Str_8 &input); private: - static char Find(const char c); + static char Find(char c); - static bool IsBase64(const char c); + static bool IsBase64(char c); }; } \ No newline at end of file diff --git a/include/ehs/BaseObj.h b/include/ehs/BaseObj.h index 76ce8b5..08e7cc0 100644 --- a/include/ehs/BaseObj.h +++ b/include/ehs/BaseObj.h @@ -5,7 +5,7 @@ namespace ehs { - class BaseObj + class EHS_LIB_IO BaseObj { private: Type* hierarchy; diff --git a/include/ehs/Color3.h b/include/ehs/Color3.h index 60d8e9f..33a0d80 100644 --- a/include/ehs/Color3.h +++ b/include/ehs/Color3.h @@ -4,7 +4,7 @@ namespace ehs { - class Color3 + class EHS_LIB_IO Color3 { public: float r; @@ -13,13 +13,13 @@ namespace ehs Color3(); - Color3(const float scalar); + Color3(float scalar); - Color3(const float r, const float g, const float b); + Color3(float r, float g, float b); Color3(const Color3& color); - Color3& operator=(const float scalar); + Color3& operator=(float scalar); Color3& operator=(const Color3& color); @@ -27,9 +27,9 @@ namespace ehs bool operator!=(const Color3& color) const; - float operator[](const UInt_64 i) const; + float operator[](UInt_64 i) const; - float& operator[](const UInt_64 i); + float& operator[](UInt_64 i); Color3& operator*=(const Color3& color); diff --git a/include/ehs/Color4.h b/include/ehs/Color4.h index 2ee80e9..7a77e77 100644 --- a/include/ehs/Color4.h +++ b/include/ehs/Color4.h @@ -5,7 +5,7 @@ namespace ehs { - class Color4 + class EHS_LIB_IO Color4 { public: float r; @@ -15,15 +15,15 @@ namespace ehs Color4(); - Color4(const float scalar); + Color4(float scalar); explicit Color4(const Color3& color); - Color4(const float r, const float g, const float b, const float a = 1.0f); + Color4(float r, float g, float b, float a = 1.0f); Color4(const Color4& color); - Color4& operator=(const float scalar); + Color4& operator=(float scalar); Color4& operator=(const Color3& color); @@ -33,9 +33,9 @@ namespace ehs bool operator!=(const Color4& color) const; - float operator[](const UInt_64 i) const; + float operator[](UInt_64 i) const; - float& operator[](const UInt_64 i); + float& operator[](UInt_64 i); Color4& operator*=(const Color4& color); diff --git a/include/ehs/Data.h b/include/ehs/Data.h index 1fe4392..ae99619 100644 --- a/include/ehs/Data.h +++ b/include/ehs/Data.h @@ -5,7 +5,7 @@ namespace ehs { - class Data + class EHS_LIB_IO Data { public: template diff --git a/include/ehs/DataType.h b/include/ehs/DataType.h index 6e0bd4e..8532f3d 100644 --- a/include/ehs/DataType.h +++ b/include/ehs/DataType.h @@ -21,9 +21,9 @@ namespace ehs UINT_8 }; - DataType FromAudioBitDepth(UInt_16 bitDepth); + EHS_LIB_IO DataType FromAudioBitDepth(UInt_16 bitDepth); - UInt_8 ToByteDepth(DataType type); + EHS_LIB_IO UInt_8 ToByteDepth(DataType type); - UInt_8 ToBitDepth(DataType type); + EHS_LIB_IO UInt_8 ToBitDepth(DataType type); } \ No newline at end of file diff --git a/include/ehs/EHS.h b/include/ehs/EHS.h index 0f5ecce..348900d 100644 --- a/include/ehs/EHS.h +++ b/include/ehs/EHS.h @@ -13,51 +13,53 @@ namespace ehs { - enum class MemoryPattern + enum class MemoryPattern { SPEED, SIZE }; + EHS_LIB_IO void Initialize(Str_8 appName, Str_8 appVerId, const Version &appVer); + + EHS_LIB_IO void Uninitialize(); + /// Retrieves the UTF32 C-style string as "Event Horizon Standard" /// @returns The result. - const Char_32* GetName_32(); + EHS_LIB_IO const Char_32* GetName_32(); /// Retrieves the UTF16 C-style string as "Event Horizon Standard" /// @returns The result. - const Char_16* GetName_16(); + EHS_LIB_IO const Char_16* GetName_16(); /// Retrieves the UTF8 C-style string as "Event Horizon Standard" /// @returns The result. - const Char_8* GetName_8(); + EHS_LIB_IO const Char_8* GetName_8(); - Str_8 GetAppName_8(); + EHS_LIB_IO Str_8 GetAppName_8(); - const Char_32* GetAcronym_32(); + EHS_LIB_IO const Char_32* GetAcronym_32(); - const Char_16* GetAcronym_16(); + EHS_LIB_IO const Char_16* GetAcronym_16(); - const Char_8* GetAcronym_8(); + EHS_LIB_IO const Char_8* GetAcronym_8(); /// Retrieves the version identifier in UTF32. /// @returns The result. - const Char_32* GetVersionId_32(); + EHS_LIB_IO const Char_32* GetVersionId_32(); /// Retrieves the version identifier in UTF16. /// @returns The result. - const Char_16* GetVersionId_16(); + EHS_LIB_IO const Char_16* GetVersionId_16(); /// Retrieves the version identifier in UTF8. /// @returns The result. - const Char_8* GetVersionId_8(); + EHS_LIB_IO const Char_8* GetVersionId_8(); - Str_8 GetAppVersionId_8(); + EHS_LIB_IO Str_8 GetAppVersionId_8(); /// Retrieves the current Event Horizon Standard version. /// @returns The result. - Version GetVersion(); + EHS_LIB_IO Version GetVersion(); - Version GetAppVersion(); -}; - -extern ehs::SInt_32 Main(ehs::Str_8* appName, ehs::Str_8* appVerId, ehs::Version* appVer); \ No newline at end of file + EHS_LIB_IO Version GetAppVersion(); +}; \ No newline at end of file diff --git a/include/ehs/GC.h b/include/ehs/GC.h index 76c2dc2..e570a76 100644 --- a/include/ehs/GC.h +++ b/include/ehs/GC.h @@ -9,7 +9,7 @@ namespace ehs { typedef bool (*GcLogic)(BaseObj*); - class GC + class EHS_LIB_IO GC { private: static Array logic; diff --git a/include/ehs/HRNG.h b/include/ehs/HRNG.h index f95e38a..3a0a203 100644 --- a/include/ehs/HRNG.h +++ b/include/ehs/HRNG.h @@ -5,7 +5,7 @@ namespace ehs { - class HRNG + class EHS_LIB_IO HRNG { public: static UInt_64 GenerateSeed_u64(); diff --git a/include/ehs/Log.h b/include/ehs/Log.h index 506240d..7eccf5a 100644 --- a/include/ehs/Log.h +++ b/include/ehs/Log.h @@ -25,7 +25,7 @@ namespace ehs /// A helper class for holding error information and handling them. /// @tparam T The character data type to use. /// @tparam N The number data type to use. - class Log + class EHS_LIB_IO Log { private: static void DefaultRaisedCb(const Log &log); diff --git a/include/ehs/Mat2.h b/include/ehs/Mat2.h index f98ce40..03767e7 100644 --- a/include/ehs/Mat2.h +++ b/include/ehs/Mat2.h @@ -120,7 +120,7 @@ namespace ehs Mat2 GetMinor() const { - Mat2 result(0); + Mat2 result; result.data[0] = data[3]; result.data[1] = data[2]; result.data[2] = data[1]; @@ -187,7 +187,7 @@ namespace ehs Mat2 GetInverse() const { T det = GetDeterminant(); - if (Math::ComCmp(det, 0.0f)) + if (Math::ComCmp(det, 0)) return {}; return GetAdjugate() * (1 / det); @@ -196,7 +196,7 @@ namespace ehs void Inverse() { T det = GetDeterminant(); - if (Math::ComCmp(det, 0.0f)) + if (Math::ComCmp(det, 0)) return; Adjugate(); @@ -212,6 +212,9 @@ namespace ehs } }; + template class EHS_LIB_IO Mat2; + template class EHS_LIB_IO Mat2; + typedef Mat2 Mat2_f; typedef Mat2 Mat2_d; } \ No newline at end of file diff --git a/include/ehs/Mat3.h b/include/ehs/Mat3.h index 74d637b..c85d237 100644 --- a/include/ehs/Mat3.h +++ b/include/ehs/Mat3.h @@ -50,7 +50,7 @@ namespace ehs Mat2 result; for (UInt_8 i = 0; i < 4; ++i) - result.data[i] = data[i / 2 * 4 + i % 2]; + result[i] = data[i / 2 * 4 + i % 2]; return result; } @@ -234,7 +234,7 @@ namespace ehs Mat3 GetInverse() const { T det = GetDeterminant(); - if (Math::ComCmp(det, 0.0f)) + if (Math::ComCmp(det, 0)) return {}; return GetAdjugate() * (1 / det); @@ -243,7 +243,7 @@ namespace ehs void Inverse() { T det = GetDeterminant(); - if (Math::ComCmp(det, 0.0f)) + if (Math::ComCmp(det, 0)) return; Adjugate(); @@ -317,6 +317,9 @@ namespace ehs } }; + template class EHS_LIB_IO Mat3; + template class EHS_LIB_IO Mat3; + typedef Mat3 Mat3_f; typedef Mat3 Mat3_d; } \ No newline at end of file diff --git a/include/ehs/Mat4.h b/include/ehs/Mat4.h index e935215..a2b620d 100644 --- a/include/ehs/Mat4.h +++ b/include/ehs/Mat4.h @@ -268,7 +268,7 @@ namespace ehs Mat4 GetInverse() const { T det = GetDeterminant(); - if (Math::ComCmp(det, 0.0f)) + if (Math::ComCmp(det, 0)) return {}; return GetAdjugate() * (1 / det); @@ -277,7 +277,7 @@ namespace ehs void Inverse() { T det = GetDeterminant(); - if (Math::ComCmp(det, 0.0f)) + if (Math::ComCmp(det, 0)) return; Adjugate(); @@ -421,6 +421,9 @@ namespace ehs } }; + template class EHS_LIB_IO Mat4; + template class EHS_LIB_IO Mat4; + typedef Mat4 Mat4_f; typedef Mat4 Mat4_d; } \ No newline at end of file diff --git a/include/ehs/Math.h b/include/ehs/Math.h index ddec883..d16d0bb 100644 --- a/include/ehs/Math.h +++ b/include/ehs/Math.h @@ -6,7 +6,7 @@ namespace ehs { - class Math + class EHS_LIB_IO Math { private: static float Sqrt_AVX(const float from); @@ -26,22 +26,22 @@ namespace ehs constexpr static double dblEpsilon = 1e-16; /// Absolute tolerance comparison for single precision floats. - static bool AbsCmp(const float a, const float b); + static bool AbsCmp(float a, float b); /// Absolute tolerance comparison for double precision floats. - static bool AbsCmp(const double a, const double b); + static bool AbsCmp(double a, double b); /// Relative tolerance comparison for single precision floats. - static bool RelCmp(const float a, const float b); + static bool RelCmp(float a, float b); /// Relative tolerance comparison for double precision floats. - static bool RelCmp(const double a, const double b); + static bool RelCmp(double a, double b); /// Combined absolute and relative tolerance comparison for single precision floats. - static bool ComCmp(const float a, const float b); + static bool ComCmp(float a, float b); /// Combined absolute and relative tolerance comparison for double precision floats. - static bool ComCmp(const double a, const double b); + static bool ComCmp(double a, double b); template static T Max(const T a, const T b) diff --git a/include/ehs/PtrData.h b/include/ehs/PtrData.h index d692fe4..e24e54c 100644 --- a/include/ehs/PtrData.h +++ b/include/ehs/PtrData.h @@ -10,9 +10,9 @@ namespace ehs void* data; }; - bool HasPtrData(void* data); + EHS_LIB_IO bool HasPtrData(void* data); - void AddPtrData(void* data); + EHS_LIB_IO void AddPtrData(void* data); - bool RemovePtrData(void* data); + EHS_LIB_IO bool RemovePtrData(void* data); } \ No newline at end of file diff --git a/include/ehs/Str.h b/include/ehs/Str.h index 367d9c6..63759b0 100644 --- a/include/ehs/Str.h +++ b/include/ehs/Str.h @@ -564,7 +564,7 @@ namespace ehs return; } - Util::Copy(data[dstOffset], src, src.Size(true)); + Util::Copy(&data[dstOffset], src, src.Size(true)); } /// Copies a C-style string to the referenced string object. @@ -580,7 +580,7 @@ namespace ehs return; } - Util::Copy(data[dstOffset], src, srcSize * sizeof(T)); + Util::Copy(&data[dstOffset], src, srcSize * sizeof(T)); } /// Copies a C-style string to the referenced string object. @@ -595,7 +595,7 @@ namespace ehs return; } - Util::Copy(data[dstOffset], src, srcSize * sizeof(T)); + Util::Copy(&data[dstOffset], src, srcSize * sizeof(T)); } /// Inserts a string at a specified index. @@ -747,7 +747,7 @@ namespace ehs T* result = new T[size + inSize + 1]; Util::Copy(result, data, Size(true)); - Util::Copy(result[size], value, inSize * sizeof(T)); + Util::Copy(&result[size], value, inSize * sizeof(T)); result[size + inSize] = 0; @@ -1027,7 +1027,7 @@ namespace ehs /// @param [in] pattern The search pattern for optimization. /// @param [in] result What index to return where the first instance is found. /// @returns The index where the instance was found with the result varying from the result parameter. - bool Find(const Str& ide, N* const index = nullptr, const SearchPattern pattern = SearchPattern::LEFT_RIGHT, const IndexResult result = IndexResult::BEGINNING) const + bool Find(const Str &ide, N* const index = nullptr, const SearchPattern pattern = SearchPattern::LEFT_RIGHT, const IndexResult result = IndexResult::BEGINNING) const { if (pattern == SearchPattern::LEFT_RIGHT) { @@ -1271,8 +1271,11 @@ namespace ehs /// @note Use "IsNum" before this if the string object is not guaranteed to be a number. float ToFloat() const { + Str ide; + ide.Push(46); + N decPoint = size; - Find(".", &decPoint); + Find(ide, &decPoint); float result = 0.0f; float fraction = 0.0f; @@ -1297,8 +1300,11 @@ namespace ehs /// @note Use "IsNum" before this if the string object is not guaranteed to be a number. double ToDouble() const { + Str ide; + ide.Push(46); + N decPoint = size; - Find(".", &decPoint); + Find(ide, &decPoint); double result = 0.0f; double fraction = 0.0f; @@ -1323,8 +1329,11 @@ namespace ehs /// @note Use "IsNum" before this if the string object is not guaranteed to be a number. long double ToLDouble() const { + Str ide; + ide.Push(46); + N decPoint = size; - Find(".", &decPoint); + Find(ide, &decPoint); long double result = 0.0f; long double fraction = 0.0f; @@ -1679,7 +1688,7 @@ namespace ehs Str result; if (whole < 0) - result += "-"; + result.Push(45); result += Str::FromNum(whole); @@ -1691,7 +1700,7 @@ namespace ehs if (!fraction) return result; - result += "."; + result.Push(46); Str fResult(maxDecimals); N i = 0; @@ -1721,7 +1730,7 @@ namespace ehs Str result; if (whole < 0) - result += "-"; + result.Push(45); result += Str::FromNum(whole); @@ -1733,7 +1742,7 @@ namespace ehs if (!fraction) return result; - result += "."; + result.Push(46); Str fResult(maxDecimals); N i = 0; @@ -1763,7 +1772,7 @@ namespace ehs Str result; if (whole < 0) - result += "-"; + result.Push(45); result += Str::FromNum(whole); @@ -1775,7 +1784,7 @@ namespace ehs if (!fraction) return result; - result += "."; + result.Push(46); Str fResult(maxDecimals); N i = 0; @@ -1892,9 +1901,13 @@ namespace ehs } }; - EHS_LIB_IO typedef Str Str_32; - EHS_LIB_IO typedef Str Str_16; - EHS_LIB_IO typedef Str Str_8; + template class EHS_LIB_IO Str; + template class EHS_LIB_IO Str; + template class EHS_LIB_IO Str; + + typedef Str Str_32; + typedef Str Str_16; + typedef Str Str_8; } template diff --git a/include/ehs/Task.h b/include/ehs/Task.h index 47d5d03..43b2e4e 100644 --- a/include/ehs/Task.h +++ b/include/ehs/Task.h @@ -9,7 +9,7 @@ namespace ehs { typedef void (*TaskCb)(Serializer*); - class Task + class EHS_LIB_IO Task { private: bool working; diff --git a/include/ehs/Type.h b/include/ehs/Type.h index 6fc7f61..bcd02b6 100644 --- a/include/ehs/Type.h +++ b/include/ehs/Type.h @@ -5,7 +5,7 @@ namespace ehs { - class Type + class EHS_LIB_IO Type { private: friend class BaseObj; diff --git a/include/ehs/URI.h b/include/ehs/URI.h index a46d8cf..b57c77b 100644 --- a/include/ehs/URI.h +++ b/include/ehs/URI.h @@ -5,7 +5,7 @@ namespace ehs { - class URI + class EHS_LIB_IO URI { public: /// Encodes specialized characters in the URI. diff --git a/include/ehs/UTF.h b/include/ehs/UTF.h index 6646d6f..a26ca28 100644 --- a/include/ehs/UTF.h +++ b/include/ehs/UTF.h @@ -13,7 +13,7 @@ namespace ehs }; /// A helper class for converting between UTF8, 16 and 32. - class UTF + class EHS_LIB_IO UTF { public: /// Converts the given UTF16 C-style string into UTF32. diff --git a/include/ehs/Util.h b/include/ehs/Util.h index c9b23f9..9295f65 100644 --- a/include/ehs/Util.h +++ b/include/ehs/Util.h @@ -4,7 +4,7 @@ namespace ehs { - class Util + class EHS_LIB_IO Util { public: static bool Compare(const void* a, const void* b, UInt_64 size); diff --git a/include/ehs/Version.h b/include/ehs/Version.h index 3c8f2b6..a0ac738 100644 --- a/include/ehs/Version.h +++ b/include/ehs/Version.h @@ -5,7 +5,7 @@ namespace ehs { /// A helper class for storing version major, minor and patch. - class Version + class EHS_LIB_IO Version { public: UInt_32 major; diff --git a/include/ehs/db/Database.h b/include/ehs/db/Database.h index 3dbed10..b3bca20 100644 --- a/include/ehs/db/Database.h +++ b/include/ehs/db/Database.h @@ -5,7 +5,7 @@ namespace ehs { - class Database + class EHS_LIB_IO Database { private: UInt_64 hashId; diff --git a/include/ehs/db/DbObject.h b/include/ehs/db/DbObject.h index 6c5309c..dfd9b69 100644 --- a/include/ehs/db/DbObject.h +++ b/include/ehs/db/DbObject.h @@ -7,7 +7,7 @@ namespace ehs { class DbTable; - class DbObject + class EHS_LIB_IO DbObject { private: friend class DbTable; diff --git a/include/ehs/db/DbTable.h b/include/ehs/db/DbTable.h index 5a53829..e703ee3 100644 --- a/include/ehs/db/DbTable.h +++ b/include/ehs/db/DbTable.h @@ -10,7 +10,7 @@ namespace ehs { class Database; - class DbTable + class EHS_LIB_IO DbTable { private: friend class Database; diff --git a/include/ehs/db/DbVar.h b/include/ehs/db/DbVar.h index 9fdc1cd..7f2e899 100644 --- a/include/ehs/db/DbVar.h +++ b/include/ehs/db/DbVar.h @@ -8,7 +8,7 @@ namespace ehs class DbVarTmpl; class DbObject; - class DbVar + class EHS_LIB_IO DbVar { private: friend class DbObject; diff --git a/include/ehs/db/DbVarTmpl.h b/include/ehs/db/DbVarTmpl.h index cc5ee76..dcff6bb 100644 --- a/include/ehs/db/DbVarTmpl.h +++ b/include/ehs/db/DbVarTmpl.h @@ -8,7 +8,7 @@ namespace ehs { class DbVar; - class DbVarTmpl + class EHS_LIB_IO DbVarTmpl { private: friend class DbTable; diff --git a/include/ehs/io/BaseDirectory.h b/include/ehs/io/BaseDirectory.h index 610349f..8294ca0 100644 --- a/include/ehs/io/BaseDirectory.h +++ b/include/ehs/io/BaseDirectory.h @@ -5,7 +5,7 @@ namespace ehs { - class BaseDirectory + class EHS_LIB_IO BaseDirectory { public: static Array GetAllFiles(const Str_8 &dir); diff --git a/include/ehs/io/BaseFile.h b/include/ehs/io/BaseFile.h index cadbbb8..d0a96c4 100644 --- a/include/ehs/io/BaseFile.h +++ b/include/ehs/io/BaseFile.h @@ -25,7 +25,7 @@ namespace ehs }; /// A cross-platform wrapper class that handles native file input/output. - class BaseFile + class EHS_LIB_IO BaseFile { protected: Str_8 path; diff --git a/include/ehs/io/BaseFileMonitor.h b/include/ehs/io/BaseFileMonitor.h index d8c56c0..7e332ad 100644 --- a/include/ehs/io/BaseFileMonitor.h +++ b/include/ehs/io/BaseFileMonitor.h @@ -11,7 +11,7 @@ namespace ehs { - class BaseFileMonitor + class EHS_LIB_IO BaseFileMonitor { protected: Str_8 filePath; diff --git a/include/ehs/io/BaseWindow.h b/include/ehs/io/BaseWindow.h index 226406a..ff08e54 100644 --- a/include/ehs/io/BaseWindow.h +++ b/include/ehs/io/BaseWindow.h @@ -18,7 +18,7 @@ namespace ehs I_BEAM }; - class BaseWindow + class EHS_LIB_IO BaseWindow { protected: bool created; diff --git a/include/ehs/io/COM.h b/include/ehs/io/COM.h index eb3b15b..64a2037 100644 --- a/include/ehs/io/COM.h +++ b/include/ehs/io/COM.h @@ -20,7 +20,7 @@ namespace ehs TWO }; - class COM + class EHS_LIB_IO COM { private: UInt_8 port; diff --git a/include/ehs/io/Console.h b/include/ehs/io/Console.h index ff4a783..e752506 100644 --- a/include/ehs/io/Console.h +++ b/include/ehs/io/Console.h @@ -12,7 +12,7 @@ namespace ehs typedef int ConsoleHdl; #endif - class Console + class EHS_LIB_IO Console { private: static ConsoleHdl hdlOut; diff --git a/include/ehs/io/Directory_LNX.h b/include/ehs/io/Directory_LNX.h index 0aae9d9..e88f9b0 100644 --- a/include/ehs/io/Directory_LNX.h +++ b/include/ehs/io/Directory_LNX.h @@ -4,7 +4,7 @@ namespace ehs { - class Directory : public BaseDirectory + class EHS_LIB_IO Directory : public BaseDirectory { public: static Array GetAllFiles(const Str_8 &dir); diff --git a/include/ehs/io/Directory_W32.h b/include/ehs/io/Directory_W32.h index ca0adba..cb18944 100644 --- a/include/ehs/io/Directory_W32.h +++ b/include/ehs/io/Directory_W32.h @@ -4,7 +4,7 @@ namespace ehs { - class Directory : public BaseDirectory + class EHS_LIB_IO Directory : public BaseDirectory { public: static Array GetAllFiles(const Str_8 &dir); diff --git a/include/ehs/io/FileMonitor_UNX.h b/include/ehs/io/FileMonitor_UNX.h index bcdf8eb..6437f4f 100644 --- a/include/ehs/io/FileMonitor_UNX.h +++ b/include/ehs/io/FileMonitor_UNX.h @@ -5,7 +5,7 @@ namespace ehs { - class FileMonitor : public BaseFileMonitor + class EHS_LIB_IO FileMonitor : public BaseFileMonitor { private: int hdl; diff --git a/include/ehs/io/FileMonitor_W32.h b/include/ehs/io/FileMonitor_W32.h index 3d29424..2bd331e 100644 --- a/include/ehs/io/FileMonitor_W32.h +++ b/include/ehs/io/FileMonitor_W32.h @@ -5,7 +5,7 @@ namespace ehs { - class FileMonitor final : public BaseFileMonitor + class EHS_LIB_IO FileMonitor final : public BaseFileMonitor { private: Handle hdl; diff --git a/include/ehs/io/File_UNX.h b/include/ehs/io/File_UNX.h index 6e10aa7..75f8e4f 100644 --- a/include/ehs/io/File_UNX.h +++ b/include/ehs/io/File_UNX.h @@ -10,7 +10,7 @@ namespace ehs { - class File : public BaseFile + class EHS_LIB_IO File : public BaseFile { private: int hdl; diff --git a/include/ehs/io/File_W32.h b/include/ehs/io/File_W32.h index 6f38812..55e1ed7 100644 --- a/include/ehs/io/File_W32.h +++ b/include/ehs/io/File_W32.h @@ -10,7 +10,7 @@ namespace ehs { - class File : public BaseFile + class EHS_LIB_IO File : public BaseFile { private: HANDLE hdl; diff --git a/include/ehs/io/FontAtlas.h b/include/ehs/io/FontAtlas.h index cb59142..e0a213c 100644 --- a/include/ehs/io/FontAtlas.h +++ b/include/ehs/io/FontAtlas.h @@ -10,7 +10,7 @@ namespace ehs { - class FontAtlas : public BaseObj + class EHS_LIB_IO FontAtlas : public BaseObj { private: UInt_64 hashId; diff --git a/include/ehs/io/Glyph.h b/include/ehs/io/Glyph.h index 6672fba..156fd1c 100644 --- a/include/ehs/io/Glyph.h +++ b/include/ehs/io/Glyph.h @@ -7,7 +7,7 @@ namespace ehs { - class Glyph + class EHS_LIB_IO Glyph { private: Char_32 code; diff --git a/include/ehs/io/RIFF.h b/include/ehs/io/RIFF.h index bcef57a..fbf256a 100644 --- a/include/ehs/io/RIFF.h +++ b/include/ehs/io/RIFF.h @@ -8,7 +8,7 @@ namespace ehs { - class RIFF + class EHS_LIB_IO RIFF { private: Str_8 type; diff --git a/include/ehs/io/RIFF_Chunk.h b/include/ehs/io/RIFF_Chunk.h index a5eea11..17dadab 100644 --- a/include/ehs/io/RIFF_Chunk.h +++ b/include/ehs/io/RIFF_Chunk.h @@ -6,7 +6,7 @@ namespace ehs { - class RIFF_Chunk + class EHS_LIB_IO RIFF_Chunk { private: Str_8 id; diff --git a/include/ehs/io/Resource.h b/include/ehs/io/Resource.h index 23e6136..0a12a2b 100644 --- a/include/ehs/io/Resource.h +++ b/include/ehs/io/Resource.h @@ -7,7 +7,7 @@ namespace ehs { - class Resource : public BaseObj + class EHS_LIB_IO Resource : public BaseObj { private: ehs::UInt_64 hashId; diff --git a/include/ehs/io/UsbBase.h b/include/ehs/io/UsbBase.h index 9994cf5..8b849a2 100644 --- a/include/ehs/io/UsbBase.h +++ b/include/ehs/io/UsbBase.h @@ -4,7 +4,7 @@ namespace ehs { - class UsbBase + class EHS_LIB_IO UsbBase { private: UInt_32 bus; diff --git a/include/ehs/io/Usb_LNX.h b/include/ehs/io/Usb_LNX.h index ea60e04..26cce7d 100644 --- a/include/ehs/io/Usb_LNX.h +++ b/include/ehs/io/Usb_LNX.h @@ -5,7 +5,7 @@ namespace ehs { - class Usb final : public UsbBase + class EHS_LIB_IO Usb final : public UsbBase { private: int hdl; diff --git a/include/ehs/io/Window_W32.h b/include/ehs/io/Window_W32.h index e88e1e8..8734f22 100644 --- a/include/ehs/io/Window_W32.h +++ b/include/ehs/io/Window_W32.h @@ -14,7 +14,7 @@ namespace ehs { - class Window : public BaseWindow + class EHS_LIB_IO Window : public BaseWindow { private: UInt_32 owner; @@ -71,13 +71,6 @@ namespace ehs void SetIcon(const Str_8& filePath); - /// Sets the windows client scale. - /// @param [in] w The width in pixels. - /// @param [in] h The height in pixels. - void SetClientSize(const Vec2& size); - - Vec2 GetClientSize(); - /// Gets the windows native handle for the operating system or other native tasks. /// @returns The window's native handle. HWND GetHdl() const; diff --git a/include/ehs/io/Window_Way.h b/include/ehs/io/Window_Way.h index 87454a4..c3047fe 100644 --- a/include/ehs/io/Window_Way.h +++ b/include/ehs/io/Window_Way.h @@ -8,7 +8,7 @@ namespace ehs { - class Window : public BaseWindow + class EHS_LIB_IO Window : public BaseWindow { protected: wl_display *display; diff --git a/include/ehs/io/Window_XCB.h b/include/ehs/io/Window_XCB.h index 6ce9784..30561be 100644 --- a/include/ehs/io/Window_XCB.h +++ b/include/ehs/io/Window_XCB.h @@ -8,7 +8,7 @@ namespace ehs { - class Window : public BaseWindow + class EHS_LIB_IO Window : public BaseWindow { protected: friend class Input; diff --git a/include/ehs/io/audio/Audio.h b/include/ehs/io/audio/Audio.h index a1ca54d..48c0b7f 100644 --- a/include/ehs/io/audio/Audio.h +++ b/include/ehs/io/audio/Audio.h @@ -11,7 +11,7 @@ namespace ehs { - class Audio : public Resource + class EHS_LIB_IO Audio : public Resource { private: static Array codecs; diff --git a/include/ehs/io/audio/AudioCodec.h b/include/ehs/io/audio/AudioCodec.h index d3df153..c3c12f2 100644 --- a/include/ehs/io/audio/AudioCodec.h +++ b/include/ehs/io/audio/AudioCodec.h @@ -8,7 +8,7 @@ namespace ehs { class Audio; - class AudioCodec + class EHS_LIB_IO AudioCodec { private: Str_8 id; diff --git a/include/ehs/io/audio/AudioDevice_ALSA.h b/include/ehs/io/audio/AudioDevice_ALSA.h index 6a2341e..c600100 100644 --- a/include/ehs/io/audio/AudioDevice_ALSA.h +++ b/include/ehs/io/audio/AudioDevice_ALSA.h @@ -7,7 +7,7 @@ namespace ehs { - class AudioDevice : public BaseAudioDevice + class EHS_LIB_IO AudioDevice : public BaseAudioDevice { private: snd_pcm_t* hdl; diff --git a/include/ehs/io/audio/AudioDevice_W32.h b/include/ehs/io/audio/AudioDevice_W32.h index f13c84a..f5bcf56 100644 --- a/include/ehs/io/audio/AudioDevice_W32.h +++ b/include/ehs/io/audio/AudioDevice_W32.h @@ -12,7 +12,7 @@ struct IMMDevice; namespace ehs { - class AudioDevice : public BaseAudioDevice + class EHS_LIB_IO AudioDevice : public BaseAudioDevice { private: IMMDevice* hdl; diff --git a/include/ehs/io/audio/BaseAudioDevice.h b/include/ehs/io/audio/BaseAudioDevice.h index e2cde25..17d143a 100644 --- a/include/ehs/io/audio/BaseAudioDevice.h +++ b/include/ehs/io/audio/BaseAudioDevice.h @@ -23,7 +23,7 @@ namespace ehs UNPLUGGED = 0x8 }; - class BaseAudioDevice + class EHS_LIB_IO BaseAudioDevice { protected: AudioDeviceType type; diff --git a/include/ehs/io/hid/Button.h b/include/ehs/io/hid/Button.h index f830837..48daa8c 100644 --- a/include/ehs/io/hid/Button.h +++ b/include/ehs/io/hid/Button.h @@ -5,7 +5,7 @@ namespace ehs { - class Button + class EHS_LIB_IO Button { private: Str_8 name; diff --git a/include/ehs/io/hid/ButtonState.h b/include/ehs/io/hid/ButtonState.h index 3d07107..487ab6c 100644 --- a/include/ehs/io/hid/ButtonState.h +++ b/include/ehs/io/hid/ButtonState.h @@ -13,7 +13,7 @@ namespace ehs TOUCHED }; - class ButtonState + class EHS_LIB_IO ButtonState { private: Button button; diff --git a/include/ehs/io/hid/HID.h b/include/ehs/io/hid/HID.h index 68800dc..4e576ea 100644 --- a/include/ehs/io/hid/HID.h +++ b/include/ehs/io/hid/HID.h @@ -7,7 +7,7 @@ namespace ehs { - class HID + class EHS_LIB_IO HID { protected: UInt_8 type; diff --git a/include/ehs/io/hid/Input.h b/include/ehs/io/hid/Input.h index 7d4f6da..5d01c5b 100644 --- a/include/ehs/io/hid/Input.h +++ b/include/ehs/io/hid/Input.h @@ -6,7 +6,7 @@ namespace ehs { - class Input + class EHS_LIB_IO Input { private: Array handlers; diff --git a/include/ehs/io/hid/InputHandler.h b/include/ehs/io/hid/InputHandler.h index 9a6b749..3d5a1f0 100644 --- a/include/ehs/io/hid/InputHandler.h +++ b/include/ehs/io/hid/InputHandler.h @@ -5,7 +5,7 @@ namespace ehs { - class InputHandler + class EHS_LIB_IO InputHandler { private: UInt_64 hashId; diff --git a/include/ehs/io/hid/Keyboard.h b/include/ehs/io/hid/Keyboard.h index 7dc13c3..c699486 100644 --- a/include/ehs/io/hid/Keyboard.h +++ b/include/ehs/io/hid/Keyboard.h @@ -8,7 +8,7 @@ namespace ehs { - class Keyboard : public HID + class EHS_LIB_IO Keyboard : public HID { public: Keyboard(); diff --git a/include/ehs/io/hid/Mouse.h b/include/ehs/io/hid/Mouse.h index 52c1f29..bbc62e6 100644 --- a/include/ehs/io/hid/Mouse.h +++ b/include/ehs/io/hid/Mouse.h @@ -9,7 +9,7 @@ namespace ehs { - class Mouse : public HID + class EHS_LIB_IO Mouse : public HID { private: friend class Input; diff --git a/include/ehs/io/img/Img.h b/include/ehs/io/img/Img.h index 672bd4e..439f8bc 100644 --- a/include/ehs/io/img/Img.h +++ b/include/ehs/io/img/Img.h @@ -13,7 +13,7 @@ namespace ehs NEAREST_NEIGHBOR }; - class Img : public BaseObj + class EHS_LIB_IO Img : public BaseObj { private: static Array codecs; diff --git a/include/ehs/io/img/ImgCodec.h b/include/ehs/io/img/ImgCodec.h index 0ab00a6..2c63eff 100644 --- a/include/ehs/io/img/ImgCodec.h +++ b/include/ehs/io/img/ImgCodec.h @@ -12,7 +12,7 @@ namespace ehs typedef bool (*EncodeImgCb)(const ImgCodec* const, Serializer&, const Img*); typedef bool (*DecodeImgCb)(const ImgCodec* const, Serializer&, Img*); - class ImgCodec + class EHS_LIB_IO ImgCodec { private: Str_8 id; diff --git a/include/ehs/io/img/PNG.h b/include/ehs/io/img/PNG.h index 6bb9912..dd8e207 100644 --- a/include/ehs/io/img/PNG.h +++ b/include/ehs/io/img/PNG.h @@ -7,7 +7,7 @@ namespace ehs { - class PNG + class EHS_LIB_IO PNG { private: Str_8 id; diff --git a/include/ehs/io/img/PNG_Chunk.h b/include/ehs/io/img/PNG_Chunk.h index 974f2ab..568fd84 100644 --- a/include/ehs/io/img/PNG_Chunk.h +++ b/include/ehs/io/img/PNG_Chunk.h @@ -6,7 +6,7 @@ namespace ehs { - class PNG_Chunk + class EHS_LIB_IO PNG_Chunk { private: Str_8 id; diff --git a/include/ehs/io/mdl/AnimBone.h b/include/ehs/io/mdl/AnimBone.h index 868a2da..ffe8892 100644 --- a/include/ehs/io/mdl/AnimBone.h +++ b/include/ehs/io/mdl/AnimBone.h @@ -6,7 +6,7 @@ namespace ehs { - class AnimBone + class EHS_LIB_IO AnimBone { private: UInt_8 boneId; diff --git a/include/ehs/io/mdl/Animation.h b/include/ehs/io/mdl/Animation.h index 8cef9c9..3f0489b 100644 --- a/include/ehs/io/mdl/Animation.h +++ b/include/ehs/io/mdl/Animation.h @@ -7,7 +7,7 @@ namespace ehs { - class Animation + class EHS_LIB_IO Animation { private: UInt_64 hashId; diff --git a/include/ehs/io/mdl/Bone.h b/include/ehs/io/mdl/Bone.h index 32844f8..49a1837 100644 --- a/include/ehs/io/mdl/Bone.h +++ b/include/ehs/io/mdl/Bone.h @@ -6,7 +6,7 @@ namespace ehs { - class Bone + class EHS_LIB_IO Bone { private: UInt_64 hashName; diff --git a/include/ehs/io/mdl/KeyFrame.h b/include/ehs/io/mdl/KeyFrame.h index 945189e..c720bcf 100644 --- a/include/ehs/io/mdl/KeyFrame.h +++ b/include/ehs/io/mdl/KeyFrame.h @@ -9,7 +9,7 @@ namespace ehs { - class KeyFrame + class EHS_LIB_IO KeyFrame { private: float num; diff --git a/include/ehs/io/mdl/Mdl.h b/include/ehs/io/mdl/Mdl.h index 4fc3f39..786c92f 100644 --- a/include/ehs/io/mdl/Mdl.h +++ b/include/ehs/io/mdl/Mdl.h @@ -15,7 +15,7 @@ namespace ehs EHM }; - class Mdl : public BaseObj + class EHS_LIB_IO Mdl : public BaseObj { private: static Array codecs; diff --git a/include/ehs/io/mdl/MdlCodec.h b/include/ehs/io/mdl/MdlCodec.h index a0a3d65..c0ae0ac 100644 --- a/include/ehs/io/mdl/MdlCodec.h +++ b/include/ehs/io/mdl/MdlCodec.h @@ -12,7 +12,7 @@ namespace ehs typedef bool (*EnocdeMdlCb)(const MdlCodec*, Serializer&, const Mdl*); typedef bool (*DecodeMdlCb)(const MdlCodec*, Serializer&, Mdl*); - class MdlCodec + class EHS_LIB_IO MdlCodec { private: Str_8 id; diff --git a/include/ehs/io/mdl/Mesh.h b/include/ehs/io/mdl/Mesh.h index af3421c..b6f2912 100644 --- a/include/ehs/io/mdl/Mesh.h +++ b/include/ehs/io/mdl/Mesh.h @@ -7,7 +7,7 @@ namespace ehs { - class Mesh final : public BaseObj + class EHS_LIB_IO Mesh final : public BaseObj { protected: UInt_64 hashId; diff --git a/include/ehs/io/mdl/PropertyChange.h b/include/ehs/io/mdl/PropertyChange.h index 13130a5..de3b256 100644 --- a/include/ehs/io/mdl/PropertyChange.h +++ b/include/ehs/io/mdl/PropertyChange.h @@ -19,7 +19,7 @@ namespace ehs INVALID }; - class PropertyChange + class EHS_LIB_IO PropertyChange { public: ChangeType type; diff --git a/include/ehs/io/socket/BaseDNS.h b/include/ehs/io/socket/BaseDNS.h index f5b5a37..f6d7d37 100644 --- a/include/ehs/io/socket/BaseDNS.h +++ b/include/ehs/io/socket/BaseDNS.h @@ -5,7 +5,7 @@ namespace ehs { - class BaseDNS + class EHS_LIB_IO BaseDNS { public: static Str_8 Resolve(AddrType type, const Str_8 &hostname); diff --git a/include/ehs/io/socket/BaseTCP.h b/include/ehs/io/socket/BaseTCP.h index 9cf6613..9e635ec 100644 --- a/include/ehs/io/socket/BaseTCP.h +++ b/include/ehs/io/socket/BaseTCP.h @@ -9,7 +9,7 @@ namespace ehs { - class BaseTCP + class EHS_LIB_IO BaseTCP { protected: AddrType addrType; diff --git a/include/ehs/io/socket/BaseUDP.h b/include/ehs/io/socket/BaseUDP.h index bae70c2..f95c5d2 100644 --- a/include/ehs/io/socket/BaseUDP.h +++ b/include/ehs/io/socket/BaseUDP.h @@ -6,7 +6,7 @@ namespace ehs { - class BaseUDP + class EHS_LIB_IO BaseUDP { protected: AddrType type; diff --git a/include/ehs/io/socket/DNS_LNX.h b/include/ehs/io/socket/DNS_LNX.h index 506f027..6a62c46 100644 --- a/include/ehs/io/socket/DNS_LNX.h +++ b/include/ehs/io/socket/DNS_LNX.h @@ -7,7 +7,7 @@ namespace ehs { - class DNS final : public BaseDNS + class EHS_LIB_IO DNS final : public BaseDNS { public: static Str_8 Resolve(AddrType type, const Str_8 &hostname); diff --git a/include/ehs/io/socket/DNS_W32.h b/include/ehs/io/socket/DNS_W32.h index 1ce9e04..1c158cb 100644 --- a/include/ehs/io/socket/DNS_W32.h +++ b/include/ehs/io/socket/DNS_W32.h @@ -4,7 +4,7 @@ namespace ehs { - class DNS final : public BaseDNS + class EHS_LIB_IO DNS final : public BaseDNS { public: static Str_8 Resolve(AddrType type, const Str_8 &hostname); diff --git a/include/ehs/io/socket/Request.h b/include/ehs/io/socket/Request.h index ada9678..f97e10a 100644 --- a/include/ehs/io/socket/Request.h +++ b/include/ehs/io/socket/Request.h @@ -16,7 +16,7 @@ namespace ehs DEL }; - class Request + class EHS_LIB_IO Request { private: Verb verb; diff --git a/include/ehs/io/socket/Response.h b/include/ehs/io/socket/Response.h index 956ed8b..5735ba4 100644 --- a/include/ehs/io/socket/Response.h +++ b/include/ehs/io/socket/Response.h @@ -8,7 +8,7 @@ namespace ehs { - class Response + class EHS_LIB_IO Response { private: UInt_32 code; diff --git a/include/ehs/io/socket/SSL.h b/include/ehs/io/socket/SSL.h index 34827c7..38ba65e 100644 --- a/include/ehs/io/socket/SSL.h +++ b/include/ehs/io/socket/SSL.h @@ -12,7 +12,7 @@ typedef struct ssl_st SSL; namespace ehs { /// A class for handling the HTTP(S) TCP socket layer. - class SSL : public TCP + class EHS_LIB_IO SSL : public TCP { private: SSL_CTX* ctx; diff --git a/include/ehs/io/socket/TCP_BSD.h b/include/ehs/io/socket/TCP_BSD.h index 1a106a3..4371df7 100644 --- a/include/ehs/io/socket/TCP_BSD.h +++ b/include/ehs/io/socket/TCP_BSD.h @@ -10,7 +10,7 @@ namespace ehs { /// A wrapper class for the transmission control protocol socket. - class TCP : public BaseTCP + class EHS_LIB_IO TCP : public BaseTCP { protected: Socket hdl; diff --git a/include/ehs/io/socket/TCP_W32.h b/include/ehs/io/socket/TCP_W32.h index 1a106a3..4371df7 100644 --- a/include/ehs/io/socket/TCP_W32.h +++ b/include/ehs/io/socket/TCP_W32.h @@ -10,7 +10,7 @@ namespace ehs { /// A wrapper class for the transmission control protocol socket. - class TCP : public BaseTCP + class EHS_LIB_IO TCP : public BaseTCP { protected: Socket hdl; diff --git a/include/ehs/io/socket/UDP_BSD.h b/include/ehs/io/socket/UDP_BSD.h index 4e9ce0a..b96bfb0 100644 --- a/include/ehs/io/socket/UDP_BSD.h +++ b/include/ehs/io/socket/UDP_BSD.h @@ -7,7 +7,7 @@ namespace ehs { /// A wrapper class for the user datagram protocol socket. - class UDP : public BaseUDP + class EHS_LIB_IO UDP : public BaseUDP { private: Socket hdl; diff --git a/include/ehs/io/socket/UDP_W32.h b/include/ehs/io/socket/UDP_W32.h index e5ee7f6..f433a24 100644 --- a/include/ehs/io/socket/UDP_W32.h +++ b/include/ehs/io/socket/UDP_W32.h @@ -7,7 +7,7 @@ namespace ehs { /// A wrapper class for the user datagram protocol socket. - class UDP : public BaseUDP + class EHS_LIB_IO UDP : public BaseUDP { private: Socket hdl; diff --git a/include/ehs/io/socket/rest/Spotify.h b/include/ehs/io/socket/rest/Spotify.h index 37140d5..1bafbb0 100644 --- a/include/ehs/io/socket/rest/Spotify.h +++ b/include/ehs/io/socket/rest/Spotify.h @@ -21,7 +21,7 @@ namespace ehs Str_8 id; }; - class Spotify final + class EHS_LIB_IO Spotify final { private: SSL client; diff --git a/include/ehs/io/socket/rest/Twitch.h b/include/ehs/io/socket/rest/Twitch.h index 0d37eff..3077b98 100644 --- a/include/ehs/io/socket/rest/Twitch.h +++ b/include/ehs/io/socket/rest/Twitch.h @@ -6,7 +6,7 @@ namespace ehs { - class Twitch + class EHS_LIB_IO Twitch { private: SSL client; diff --git a/include/ehs/io/socket/rest/TwitchChat.h b/include/ehs/io/socket/rest/TwitchChat.h index c971e44..60047de 100644 --- a/include/ehs/io/socket/rest/TwitchChat.h +++ b/include/ehs/io/socket/rest/TwitchChat.h @@ -6,7 +6,7 @@ namespace ehs { - class TwitchChat + class EHS_LIB_IO TwitchChat { private: TCP client; diff --git a/include/ehs/json/Json.h b/include/ehs/json/Json.h index d0bcdf1..b61a250 100644 --- a/include/ehs/json/Json.h +++ b/include/ehs/json/Json.h @@ -12,7 +12,7 @@ namespace ehs { - class Json + class EHS_LIB_IO Json { private: JsonBase* value; diff --git a/include/ehs/json/JsonArray.h b/include/ehs/json/JsonArray.h index 3f56683..ca0d5df 100644 --- a/include/ehs/json/JsonArray.h +++ b/include/ehs/json/JsonArray.h @@ -11,7 +11,7 @@ namespace ehs class JsonNum; class JsonStr; - class JsonArray : public JsonBase + class EHS_LIB_IO JsonArray : public JsonBase { private: UInt_64 size; diff --git a/include/ehs/json/JsonBase.h b/include/ehs/json/JsonBase.h index 7322096..3706347 100644 --- a/include/ehs/json/JsonBase.h +++ b/include/ehs/json/JsonBase.h @@ -15,7 +15,7 @@ namespace ehs STR }; - class JsonBase + class EHS_LIB_IO JsonBase { private: JsonType type; diff --git a/include/ehs/json/JsonBool.h b/include/ehs/json/JsonBool.h index f0c1735..0047312 100644 --- a/include/ehs/json/JsonBool.h +++ b/include/ehs/json/JsonBool.h @@ -7,7 +7,7 @@ namespace ehs { - class JsonBool : public JsonBase + class EHS_LIB_IO JsonBool : public JsonBase { public: bool value; diff --git a/include/ehs/json/JsonNum.h b/include/ehs/json/JsonNum.h index bfb2695..4e5a085 100644 --- a/include/ehs/json/JsonNum.h +++ b/include/ehs/json/JsonNum.h @@ -7,7 +7,7 @@ namespace ehs { - class JsonNum : public JsonBase + class EHS_LIB_IO JsonNum : public JsonBase { public: float value; diff --git a/include/ehs/json/JsonObj.h b/include/ehs/json/JsonObj.h index dfb5941..03bcaf1 100644 --- a/include/ehs/json/JsonObj.h +++ b/include/ehs/json/JsonObj.h @@ -9,7 +9,7 @@ namespace ehs { class JsonVar; - class JsonObj : public JsonBase + class EHS_LIB_IO JsonObj : public JsonBase { protected: UInt_64 size; diff --git a/include/ehs/json/JsonStr.h b/include/ehs/json/JsonStr.h index f5cc501..e6d74e8 100644 --- a/include/ehs/json/JsonStr.h +++ b/include/ehs/json/JsonStr.h @@ -7,7 +7,7 @@ namespace ehs { - class JsonStr : public JsonBase + class EHS_LIB_IO JsonStr : public JsonBase { public: Str_8 value; diff --git a/include/ehs/json/JsonVar.h b/include/ehs/json/JsonVar.h index 14210c8..cefbc5c 100644 --- a/include/ehs/json/JsonVar.h +++ b/include/ehs/json/JsonVar.h @@ -12,7 +12,7 @@ namespace ehs class JsonNum; class JsonStr; - class JsonVar + class EHS_LIB_IO JsonVar { private: UInt_64 hashId; diff --git a/include/ehs/system/BaseMutex.h b/include/ehs/system/BaseMutex.h index 10229df..ef7901b 100644 --- a/include/ehs/system/BaseMutex.h +++ b/include/ehs/system/BaseMutex.h @@ -4,7 +4,7 @@ namespace ehs { - class BaseMutex + class EHS_LIB_IO BaseMutex { protected: bool initialized; diff --git a/include/ehs/system/BaseOpen.h b/include/ehs/system/BaseOpen.h index 217eadb..8f16aa6 100644 --- a/include/ehs/system/BaseOpen.h +++ b/include/ehs/system/BaseOpen.h @@ -4,7 +4,7 @@ namespace ehs { - class BaseOpen + class EHS_LIB_IO BaseOpen { protected: Str_8 filePath; diff --git a/include/ehs/system/BaseSemaphore.h b/include/ehs/system/BaseSemaphore.h index 4ef1eaa..b588908 100644 --- a/include/ehs/system/BaseSemaphore.h +++ b/include/ehs/system/BaseSemaphore.h @@ -5,7 +5,7 @@ namespace ehs { - class BaseSemaphore + class EHS_LIB_IO BaseSemaphore { private: Str_8 name; diff --git a/include/ehs/system/BaseSystem.h b/include/ehs/system/BaseSystem.h index 4818367..a19fe66 100644 --- a/include/ehs/system/BaseSystem.h +++ b/include/ehs/system/BaseSystem.h @@ -5,7 +5,7 @@ namespace ehs { - class BaseSystem + class EHS_LIB_IO BaseSystem { public: static void OpenURI(const Str_8& uri); diff --git a/include/ehs/system/CPU.h b/include/ehs/system/CPU.h index e88d69d..2d39d0d 100644 --- a/include/ehs/system/CPU.h +++ b/include/ehs/system/CPU.h @@ -30,7 +30,7 @@ namespace ehs UInt_32 lowCount = 0; }; - class CPU + class EHS_LIB_IO CPU { private: #ifdef EHS_OS_LINUX diff --git a/include/ehs/system/FileSystem.h b/include/ehs/system/FileSystem.h index 6f41550..5b7ff79 100644 --- a/include/ehs/system/FileSystem.h +++ b/include/ehs/system/FileSystem.h @@ -5,7 +5,7 @@ namespace ehs { - class FileSystem + class EHS_LIB_IO FileSystem { public: static void SetWorkingDir(const Str_8& dir); diff --git a/include/ehs/system/Mutex_PT.h b/include/ehs/system/Mutex_PT.h index 422b2aa..643869c 100644 --- a/include/ehs/system/Mutex_PT.h +++ b/include/ehs/system/Mutex_PT.h @@ -7,7 +7,7 @@ namespace ehs { - class Mutex : public BaseMutex + class EHS_LIB_IO Mutex : public BaseMutex { private: pthread_mutex_t hdl; diff --git a/include/ehs/system/Mutex_W32.h b/include/ehs/system/Mutex_W32.h index 8e1a383..010d0aa 100644 --- a/include/ehs/system/Mutex_W32.h +++ b/include/ehs/system/Mutex_W32.h @@ -5,7 +5,7 @@ namespace ehs { - class Mutex : public BaseMutex + class EHS_LIB_IO Mutex : public BaseMutex { private: HANDLE hdl; diff --git a/include/ehs/system/OS.h b/include/ehs/system/OS.h index d5bc370..b72868e 100644 --- a/include/ehs/system/OS.h +++ b/include/ehs/system/OS.h @@ -6,9 +6,9 @@ #define EHS_FUNC __FUNCTION__ #define EHS_LINE __LINE__ - #if defined(EHS_EXPORT) + #if defined(EHS_LIB_EXPORT) #define EHS_LIB_IO __declspec(dllexport) - #elif defined(EHS_IMPORT) + #elif defined(EHS_LIB_IMPORT) #define EHS_LIB_IO __declspec(dllimport) #else #define EHS_LIB_IO diff --git a/include/ehs/system/Open_UNX.h b/include/ehs/system/Open_UNX.h index ce895be..3c06bd2 100644 --- a/include/ehs/system/Open_UNX.h +++ b/include/ehs/system/Open_UNX.h @@ -4,7 +4,7 @@ namespace ehs { - class Open : public BaseOpen + class EHS_LIB_IO Open : public BaseOpen { private: void* hdl; diff --git a/include/ehs/system/Open_W32.h b/include/ehs/system/Open_W32.h index acf00b8..3dc9be2 100644 --- a/include/ehs/system/Open_W32.h +++ b/include/ehs/system/Open_W32.h @@ -1,16 +1,11 @@ -// -// Created by karutoh on 11/14/23. -// +#pragma once -#ifndef OPEN_W32_H -#define OPEN_W32_H +#include "BaseOpen.h" -namespace ehs { +namespace ehs +{ + class EHS_LIB_IO Open : public BaseOpen + { -class Open_W32 { - -}; - -} // lwe - -#endif //OPEN_W32_H + }; +} diff --git a/include/ehs/system/Semaphore_P.h b/include/ehs/system/Semaphore_P.h index 6ada2de..0926659 100644 --- a/include/ehs/system/Semaphore_P.h +++ b/include/ehs/system/Semaphore_P.h @@ -8,7 +8,7 @@ namespace ehs { - class Semaphore : public BaseSemaphore + class EHS_LIB_IO Semaphore : public BaseSemaphore { private: sem_t hdl; diff --git a/include/ehs/system/Semaphore_W32.h b/include/ehs/system/Semaphore_W32.h index 8735e3c..ae23e28 100644 --- a/include/ehs/system/Semaphore_W32.h +++ b/include/ehs/system/Semaphore_W32.h @@ -6,7 +6,7 @@ namespace ehs { - class Semaphore : public BaseSemaphore + class EHS_LIB_IO Semaphore : public BaseSemaphore { private: HANDLE hdl; diff --git a/include/ehs/system/System_LNX.h b/include/ehs/system/System_LNX.h index e09dbe6..8bdda01 100644 --- a/include/ehs/system/System_LNX.h +++ b/include/ehs/system/System_LNX.h @@ -5,7 +5,7 @@ namespace ehs { - class System : public BaseSystem + class EHS_LIB_IO System : public BaseSystem { public: static void OpenURI(const Str_8& uri); diff --git a/include/ehs/system/System_W32.h b/include/ehs/system/System_W32.h index 8bf8109..148aa20 100644 --- a/include/ehs/system/System_W32.h +++ b/include/ehs/system/System_W32.h @@ -4,7 +4,7 @@ namespace ehs { - class System : public BaseSystem + class EHS_LIB_IO System : public BaseSystem { public: static void OpenURI(const Str_8& uri); diff --git a/include/ehs/system/Thread.h b/include/ehs/system/Thread.h index e73a4b7..a4dbcc3 100644 --- a/include/ehs/system/Thread.h +++ b/include/ehs/system/Thread.h @@ -20,7 +20,7 @@ namespace ehs typedef UInt_64 THandle; #endif - class Thread + class EHS_LIB_IO Thread { private: static UInt_32 mainId; diff --git a/include/ehs/system/User.h b/include/ehs/system/User.h index f91b633..df4b2fb 100644 --- a/include/ehs/system/User.h +++ b/include/ehs/system/User.h @@ -5,7 +5,7 @@ namespace ehs { - class User + class EHS_LIB_IO User { public: static void GetId(UInt_32* const real, UInt_32* const effective, UInt_32* const saved); diff --git a/src/Base64.cpp b/src/Base64.cpp index 852bfb1..0e07821 100644 --- a/src/Base64.cpp +++ b/src/Base64.cpp @@ -4,7 +4,7 @@ namespace ehs { const char Base64::ascii[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - Str_8 Base64::Encode(const Str_8 input) + Str_8 Base64::Encode(const Str_8 &input) { UInt_64 input_length = input.Size(); @@ -42,7 +42,7 @@ namespace ehs return result; } - Str_8 Base64::Decode(const Str_8 input) + Str_8 Base64::Decode(const Str_8 &input) { UInt_64 in_len = input.Size(); int i = 0; diff --git a/src/EHS.cpp b/src/EHS.cpp index 92342a9..a55ad02 100644 --- a/src/EHS.cpp +++ b/src/EHS.cpp @@ -31,6 +31,64 @@ namespace ehs Str_8 appVerId; Version appVer; + void Initialize(Str_8 appName, Str_8 appVerId, const Version &appVer) + { + ehs::appName = (Str_8 &&)appName; + ehs::appVerId = (Str_8 &&)appVerId; + ehs::appVer = appVer; + + ehs::Console::Attach(); + + ehs::Audio::AddCodec({ + "Waveform Audio", + "wav", + ehs::Endianness::LE, + nullptr, + ehs::DecodeWAV + }); + + ehs::Audio::AddCodec({ + "Event Horizon Audio", + "eha", + ehs::Endianness::LE, + ehs::EncodeEHA, + ehs::DecodeEHA + }); + + ehs::Img::AddCodec({ + "Portable Network Graphic", + "png", + ehs::Endianness::BE, + nullptr, + ehs::DecodePNG + }); + + ehs::Img::AddCodec({ + "Quite OK Image", + "qoi", + ehs::Endianness::BE, + ehs::EncodeQOI, + ehs::DecodeQOI + }); + + ehs::Mdl::AddCodec({ + "Event Horizon Model", + "ehm", + ehs::Endianness::LE, + ehs::EncodeEHM, + ehs::DecodeEHM + }); + + ehs::GC::Start(); + } + + void Uninitialize() + { + ehs::GC::Stop(); + + ehs::Log::OnExit(); + } + const Char_32* GetName_32() { return name_32; @@ -95,61 +153,4 @@ namespace ehs { return appVer; } -} - -int main() -{ - ehs::Console::Attach(); - - ehs::Audio::AddCodec({ - "Waveform Audio", - "wav", - ehs::Endianness::LE, - nullptr, - ehs::DecodeWAV - }); - - ehs::Audio::AddCodec({ - "Event Horizon Audio", - "eha", - ehs::Endianness::LE, - ehs::EncodeEHA, - ehs::DecodeEHA - }); - - ehs::Img::AddCodec({ - "Portable Network Graphic", - "png", - ehs::Endianness::BE, - nullptr, - ehs::DecodePNG - }); - - ehs::Img::AddCodec({ - "Quite OK Image", - "qoi", - ehs::Endianness::BE, - ehs::EncodeQOI, - ehs::DecodeQOI - }); - - ehs::Mdl::AddCodec({ - "Event Horizon Model", - "ehm", - ehs::Endianness::LE, - ehs::EncodeEHM, - ehs::DecodeEHM - }); - - ehs::GC::Start(); - - const ehs::SInt_32 code = Main(&ehs::appName, &ehs::appVerId, &ehs::appVer); - if (code) - EHS_LOG_INT(ehs::LogType::WARN, 0, "Executable exited with code #" + ehs::Str_8::FromNum(code) + "."); - - ehs::GC::Stop(); - - ehs::Log::OnExit(); - - return code; } \ No newline at end of file diff --git a/src/StrToHash.cpp b/src/StrToHash.cpp index adc9fee..eda53e9 100644 --- a/src/StrToHash.cpp +++ b/src/StrToHash.cpp @@ -2,11 +2,9 @@ #include #include -ehs::Int_32 Main(ehs::Str_8* appName, ehs::Str_8* appVerId, ehs::Version* appVer) +int main() { - *appName = "StrToHash"; - *appVerId = "Release"; - *appVer = {1, 0, 0}; + ehs::Initialize("StrToHash", "Release", {1, 0, 0}); ehs::Vector args = ehs::Console::GetArgs_8(); @@ -26,5 +24,7 @@ ehs::Int_32 Main(ehs::Str_8* appName, ehs::Str_8* appVerId, ehs::Version* appVer ehs::Console::Free(); + ehs::Uninitialize(); + return 0; } diff --git a/src/db/Database.cpp b/src/db/Database.cpp index 25080ae..771b3f8 100644 --- a/src/db/Database.cpp +++ b/src/db/Database.cpp @@ -1,6 +1,6 @@ #include "ehs/db/Database.h" -#include "ehs/io/Directory_LNX.h" +#include "ehs/io/Directory.h" #include "ehs/io/File.h" namespace ehs diff --git a/src/db/DbObject.cpp b/src/db/DbObject.cpp index cb0a23f..c7760bb 100644 --- a/src/db/DbObject.cpp +++ b/src/db/DbObject.cpp @@ -2,7 +2,7 @@ #include "ehs/db/DbTable.h" #include "ehs/Serializer.h" #include "ehs/db/Database.h" -#include "ehs/io/Directory_LNX.h" +#include "ehs/io/Directory.h" #include "ehs/io/File.h" namespace ehs diff --git a/src/db/DbTable.cpp b/src/db/DbTable.cpp index 772f19a..27382bf 100644 --- a/src/db/DbTable.cpp +++ b/src/db/DbTable.cpp @@ -1,7 +1,7 @@ #include "ehs/db/DbTable.h" #include "ehs/db/Database.h" #include "ehs/io/Directory.h" -#include "ehs/io/File_UNX.h" +#include "ehs/io/File.h" namespace ehs { diff --git a/src/io/Directory_W32.cpp b/src/io/Directory_W32.cpp index dbaf2ad..10fb3ef 100644 --- a/src/io/Directory_W32.cpp +++ b/src/io/Directory_W32.cpp @@ -4,7 +4,7 @@ namespace ehs { - Array GetAllFiles(const Str_8 &dir) + Array Directory::GetAllFiles(const Str_8 &dir) { Array result; @@ -44,7 +44,7 @@ namespace ehs return result; } - void CreateRecursive(Str_8 dir) + void Directory::CreateRecursive(Str_8 dir) { dir = dir.ReplaceAll("\\", "/"); @@ -71,7 +71,7 @@ namespace ehs EHS_LOG_SUCCESS(); } - void Create(const Str_8 &dir) + void Directory::Create(const Str_8 &dir) { if (!CreateDirectoryW(UTF::To_16(dir), nullptr)) { diff --git a/src/io/Window_W32.cpp b/src/io/Window_W32.cpp index cb18179..ac15850 100644 --- a/src/io/Window_W32.cpp +++ b/src/io/Window_W32.cpp @@ -611,7 +611,11 @@ namespace ehs return {(Int_32)tmp.left, (Int_32)tmp.top}; } - void Window::SetClientSize(const Vec2& size) + void Window::OnResized(const Vec2& newSize) + { + } + + void Window::SetScale(const Vec2_u32& newScale) { if (!created) return; @@ -619,8 +623,8 @@ namespace ehs RECT rect = { 0, 0, - static_cast(size[0]), - static_cast(size[1]) + static_cast(newScale[0]), + static_cast(newScale[1]) }; DWORD exStyle = (DWORD)GetWindowLongPtr(hdl, GWL_EXSTYLE); @@ -631,35 +635,13 @@ namespace ehs SetWindowPos(hdl, nullptr, 0, 0, rect.right - rect.left, rect.bottom - rect.top, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); } - Vec2 Window::GetClientSize() - { - RECT rect = {}; - - if (!GetClientRect(hdl, &rect)) - EHS_LOG_INT(LogType::ERR, 0, "Failed to retrieve client size with error #" + Str_8::FromNum(GetLastError()) + "."); - - return {(UInt_32)rect.right, (UInt_32)rect.bottom}; - } - - void Window::OnResized(const Vec2& newSize) - { - } - - void Window::SetScale(const Vec2_u32& newScale) - { - if (!created) - return; - - SetWindowPos(hdl, nullptr, 0, 0, (int)newScale.x, (int)newScale.y, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); - } - Vec2_u32 Window::GetScale() const { if (!created) return {}; RECT tmp = {}; - GetWindowRect(hdl, &tmp); + GetClientRect(hdl, &tmp); return {(UInt_32)(tmp.right - tmp.left), (UInt_32)(tmp.bottom - tmp.top)}; }