Fixed window for Windows.
All checks were successful
Build & Release / Windows-AMD64-Build (push) Successful in 1m15s
Build & Release / Linux-AMD64-Build (push) Successful in 1m21s
Build & Release / Linux-AARCH64-Build (push) Successful in 3m20s

This commit is contained in:
2024-02-05 23:55:53 -08:00
parent a7331d5561
commit 586ed2dfd2
3 changed files with 50 additions and 31 deletions

View File

@@ -40,11 +40,11 @@ namespace ehs
BaseWindow& operator=(const BaseWindow& win);
virtual void Create_32(const Str_32& title, const Vec2_s32& pos, const Vec2_u32 scale) = 0;
virtual void Create_32(const Str_32& title, const Vec2_s32& pos, Vec2_u32 scale) = 0;
virtual void Create_16(const Str_16& title, const Vec2_s32& pos, const Vec2_u32 scale) = 0;
virtual void Create_16(const Str_16& title, const Vec2_s32& pos, Vec2_u32 scale) = 0;
virtual void Create_8(const Str_8& title, const Vec2_s32& pos, const Vec2_u32 scale) = 0;
virtual void Create_8(const Str_8& title, const Vec2_s32& pos, Vec2_u32 scale) = 0;
virtual void OnCreated() = 0;
@@ -60,7 +60,7 @@ namespace ehs
bool HasFocus() const;
void EnableResizing(const bool enable);
void EnableResizing(bool enable);
bool IsResizable() const;
@@ -77,7 +77,7 @@ namespace ehs
/// @returns The current status.
bool IsCursorVisible() const;
virtual void ConstrainCursor(const bool constrain) = 0;
virtual void ConstrainCursor(bool constrain) = 0;
bool IsCursorConstrained() const;
@@ -109,6 +109,6 @@ namespace ehs
virtual void SetClipboard(Serializer<UInt_64> data) = 0;
virtual void SetCursorImg(const CursorImg img) = 0;
virtual void SetCursorImg(CursorImg img) = 0;
};
}

View File

@@ -26,7 +26,7 @@ namespace ehs
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
public:
virtual ~Window() override;
~Window() override;
Window();
@@ -34,22 +34,22 @@ namespace ehs
Window& operator=(const Window &win);
virtual bool Poll() override;
bool Poll() override;
///Creates the native window.
void Create_32(const Str_32& title, const Vec2_s32& pos, const Vec2_u32 scale) override;
void Create_32(const Str_32& title, const Vec2_s32& pos, Vec2_u32 scale) override;
///Creates the native window.
void Create_16(const Str_16& title, const Vec2_s32& pos, const Vec2_u32 scale) override;
void Create_16(const Str_16& title, const Vec2_s32& pos, Vec2_u32 scale) override;
///Creates the native window.
void Create_8(const Str_8& title, const Vec2_s32& pos, const Vec2_u32 scale) override;
void Create_8(const Str_8& title, const Vec2_s32& pos, Vec2_u32 scale) override;
///Uses an already existing window to render an overlay.
void Use(HWND windowHdl);
///Closes the window.
virtual void Close() override;
void Close() override;
///Shows the window.
void Show() override;
@@ -59,15 +59,15 @@ namespace ehs
void SetTitle_32(const Str_32& title) override;
Str_32 GetTitle_32();
Str_32 GetTitle_32() const override;
void SetTitle_16(const Str_16& title) override;
Str_16 GetTitle_16();
Str_16 GetTitle_16() const override;
void SetTitle_8(const Str_8& title) override;
Str_8 GetTitle_8();
Str_8 GetTitle_8() const override;
void SetIcon(const Str_8& filePath);
@@ -99,29 +99,35 @@ namespace ehs
/// Sets the windows position on the desktop.
/// @param [in] x The x axis in pixels.
/// @param [in] y The y axis in pixels.
void SetPos(int x, int y);
void SetPos(const Vec2_s32& newPos) override;
/// Gets the windows current position on the desktop.
/// @returns The current value.
Vec2<Int_32> GetPos();
Vec2_s32 GetPos() const override;
virtual void OnResized(const Vec2<UInt_32>& newSize);
/// Sets the windows scale which includes the border.
/// @param [in] w The width in pixels.
/// @param [in] h The height in pixels.
void SetSize(int w, int h);
void SetScale(const Vec2_u32& newScale) override;
/// Gets the windows current scale.
/// @returns The current value.
Vec2<Int_32> GetSize();
Vec2_u32 GetScale() const override;
void ShowCursor(bool toggle) override;
void ConstrainCursor(const bool toggle) override;
void ConstrainCursor(bool toggle) override;
Serializer<UInt_64> GetClipboard() override;
void SetClipboard(Serializer<UInt_64> data) override;
void SetCursorImg(CursorImg img) override;
protected:
void SendMsg(const UINT msg, const WPARAM wParam, const LPARAM lParam);
void SendMsg(UINT msg, WPARAM wParam, LPARAM lParam);
};
}