From 0f6bd4d19957a21e71e38bb181f5585898a1fc14 Mon Sep 17 00:00:00 2001 From: Alain Galvan Date: Fri, 1 Apr 2022 16:49:17 -0400 Subject: [PATCH 1/4] Update readme.md --- readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 8fd8ac3..1c0fb20 100644 --- a/readme.md +++ b/readme.md @@ -180,9 +180,9 @@ void xmain(int argc, const char** argv) { const xwin::Event& event = eventQueue.front(); - if (event.type == xwin::EventType::MouseMove) + if (event.type == xwin::EventType::MouseInput) { - const xwin::MouseData mouse = event.data.mouse; + const xwin::MouseInputData mouse = event.data.mouseInput; } if (event.type == xwin::EventType::Close) { @@ -208,7 +208,7 @@ Be sure to have [CMake](https://cmake.org) Installed. | `XWIN_API` | The OS API to use for window generation, defaults to `AUTO`, can be can be `NOOP`, `WIN32`, `COCOA`, `UIKIT`, `XCB` , `ANDROID`, or `WASM`. | | `XWIN_OS` | **Optional** - What Operating System to build for, functions as a quicker way of setting target platforms. Defaults to `AUTO`, can be `NOOP`, `WINDOWS`, `MACOS`, `LINUX`, `ANDROID`, `IOS`, `WASM`. If your platform supports multiple apis, the final api will be automatically set to CrossWindow defaults ( `WIN32` on Windows, `XCB` on Linux ). If `XWIN_API` is set this option is ignored. | -First install [Git](https://git-scm.com/downloads), then open any terminal such as [Hyper](https://hyper.is/) in any folder and type: +First install [Git](https://git-scm.com/downloads), then open any terminal in any folder and type: ```bash # 🐑 Clone the repo From 8f7d0d24175f91e577d679847ee4060a80ee6aa8 Mon Sep 17 00:00:00 2001 From: Alain Galvan Date: Tue, 5 Apr 2022 14:41:57 -0400 Subject: [PATCH 2/4] Fixed build on Noop This was a lingering issue making the repo page look off. --- src/CrossWindow/Common/Event.cpp | 4 ++-- src/CrossWindow/Noop/NoopWindow.cpp | 5 ++++- src/CrossWindow/Win32/Win32EventQueue.cpp | 9 ++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/CrossWindow/Common/Event.cpp b/src/CrossWindow/Common/Event.cpp index 9a18886..1622b63 100644 --- a/src/CrossWindow/Common/Event.cpp +++ b/src/CrossWindow/Common/Event.cpp @@ -79,7 +79,7 @@ ResizeData::ResizeData(unsigned width, unsigned height, bool resizing) * (Mac OS, iOS, WebAssembly) we should opt to use those functions. */ static KeyToCharMap sKeyToCharMap = { - "\e", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "\b", + "\x1B", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "\b", "\t", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "[", "]", "\r", "", "A", "S", "D", "F", "G", "H", "J", "K", "L", ";", ":", "'", "\"", "`", "", "\\", "Z", "X", "C", "V", "B", "N", "M", ",", ".", "/", "", @@ -89,7 +89,7 @@ static KeyToCharMap sKeyToCharMap = { "", "", "", "", "", "", "", ""}; static std::unordered_map sCharToKeyMap = { - {"\e", Key::Escape}, + {"\x1B", Key::Escape}, {"1", Key::Num1}, {"2", Key::Num2}, {"3", Key::Num3}, diff --git a/src/CrossWindow/Noop/NoopWindow.cpp b/src/CrossWindow/Noop/NoopWindow.cpp index c13130c..d8e2e53 100644 --- a/src/CrossWindow/Noop/NoopWindow.cpp +++ b/src/CrossWindow/Noop/NoopWindow.cpp @@ -4,7 +4,10 @@ namespace xwin { Window::~Window() { close(); } -bool Window::create(WindowDesc& desc, EventQueue& eventQueue) { return false; } +bool Window::create(const WindowDesc& desc, EventQueue& eventQueue) +{ + return false; +} void Window::close() {} diff --git a/src/CrossWindow/Win32/Win32EventQueue.cpp b/src/CrossWindow/Win32/Win32EventQueue.cpp index 47d73b4..01eb3b9 100644 --- a/src/CrossWindow/Win32/Win32EventQueue.cpp +++ b/src/CrossWindow/Win32/Win32EventQueue.cpp @@ -786,11 +786,10 @@ LRESULT EventQueue::pushEvent(MSG msg, Window* window) // Some events may require resizing the current window, // such as DPI events. - if ( - !(currentWindowRect.right == currentWindowRect.left && - currentWindowRect.right == currentWindowRect.top && - currentWindowRect.right == currentWindowRect.bottom && - currentWindowRect.right == -1)) + if (!(currentWindowRect.right == currentWindowRect.left && + currentWindowRect.right == currentWindowRect.top && + currentWindowRect.right == currentWindowRect.bottom && + currentWindowRect.right == -1)) { RECT* const prcNewWindow = (RECT*)msg.lParam; SetWindowPos(window->hwnd, NULL, currentWindowRect.left, From 9b5a00bc45f0ec881d20c6284a5e9932c76b2637 Mon Sep 17 00:00:00 2001 From: Alain Galvan Date: Tue, 5 Apr 2022 14:46:31 -0400 Subject: [PATCH 3/4] Fixed Noop Window Some state wasn't being maintained as expected. --- src/CrossWindow/Noop/NoopWindow.cpp | 14 +++----------- src/CrossWindow/Noop/NoopWindow.h | 3 +++ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/CrossWindow/Noop/NoopWindow.cpp b/src/CrossWindow/Noop/NoopWindow.cpp index d8e2e53..2b6d577 100644 --- a/src/CrossWindow/Noop/NoopWindow.cpp +++ b/src/CrossWindow/Noop/NoopWindow.cpp @@ -6,24 +6,16 @@ Window::~Window() { close(); } bool Window::create(const WindowDesc& desc, EventQueue& eventQueue) { + mDesc = desc; return false; } void Window::close() {} -const WindowDesc Window::getDesc() { return WindowDesc(); } -void Window::updateDesc(WindowDesc& desc) {} - -bool create(WindowDesc& desc, EventQueue& eventQueue) { return true; } - -const WindowDesc getDesc() -{ - WindowDesc wd; - return wd; -} +const WindowDesc Window::getDesc() { return mDesc; } -void updateDesc(WindowDesc& desc) {} +void Window::updateDesc(WindowDesc& desc) {} void Window::setTitle(std::string title) {} diff --git a/src/CrossWindow/Noop/NoopWindow.h b/src/CrossWindow/Noop/NoopWindow.h index c21b67f..968ddb5 100644 --- a/src/CrossWindow/Noop/NoopWindow.h +++ b/src/CrossWindow/Noop/NoopWindow.h @@ -37,5 +37,8 @@ class Window // returns the current top left corner this window is located in UVec2 getCurrentDisplayPosition(); + + protected: + WindowDesc mDesc; }; } From 3fb97e884ecf27a55adb68cec9def10516a48131 Mon Sep 17 00:00:00 2001 From: Alain Galvan Date: Tue, 5 Apr 2022 15:02:22 -0400 Subject: [PATCH 4/4] Dropping Travis, fixing appveyor build Travis has been giving me problems for a very long time, I paid 60 dollars for credits and it still bugs out. I won't be using it for builds anymore. --- .appveyor.yml | 2 +- readme.md | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index ac80020..6556fa7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -5,7 +5,7 @@ # build version format version: "{build}" -os: Visual Studio 2017 +os: Visual Studio 2019 platform: - x64 diff --git a/readme.md b/readme.md index 1c0fb20..c68e787 100644 --- a/readme.md +++ b/readme.md @@ -8,7 +8,6 @@ [![cmake-img]][cmake-url] [![License][license-img]][license-url] -[![Travis Tests][travis-img]][travis-url] [![Appveyor Tests][appveyor-img]][appveyor-url] [![Coverage Tests][codecov-img]][codecov-url] @@ -254,8 +253,6 @@ CrossWindow is licensed as either **MIT** or **Apache-2.0**, whichever you would [cmake-url]: https://cmake.org/ [license-img]: https://img.shields.io/:license-mit-blue.svg?style=flat-square [license-url]: https://opensource.org/licenses/MIT -[travis-img]: https://img.shields.io/travis/com/alaingalvan/crosswindow?style=flat-square -[travis-url]: https://app.travis-ci.com/github/alaingalvan/CrossWindow [appveyor-img]: https://img.shields.io/appveyor/ci/alaingalvan/CrossWindow.svg?style=flat-square&logo=windows [appveyor-url]: https://ci.appveyor.com/project/alaingalvan/crosswindow [circleci-img]: https://img.shields.io/circleci/project/github/alaingalvan/CrossWindow.svg?style=flat-square&logo=appveyor