Added shared library support.

This commit is contained in:
2024-07-24 01:36:20 -07:00
parent 1b70383448
commit 8e7cc39000
122 changed files with 298 additions and 298 deletions

View File

@@ -4,7 +4,7 @@
namespace ehs
{
Array<Str_8> GetAllFiles(const Str_8 &dir)
Array<Str_8> Directory::GetAllFiles(const Str_8 &dir)
{
Array<Str_8> 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))
{

View File

@@ -611,7 +611,11 @@ namespace ehs
return {(Int_32)tmp.left, (Int_32)tmp.top};
}
void Window::SetClientSize(const Vec2<UInt_32>& size)
void Window::OnResized(const Vec2<UInt_32>& newSize)
{
}
void Window::SetScale(const Vec2_u32& newScale)
{
if (!created)
return;
@@ -619,8 +623,8 @@ namespace ehs
RECT rect = {
0,
0,
static_cast<LONG>(size[0]),
static_cast<LONG>(size[1])
static_cast<LONG>(newScale[0]),
static_cast<LONG>(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<UInt_32> 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<UInt_32>& 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)};
}