aboutsummaryrefslogtreecommitdiff
path: root/src/engine/user/cursor.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-14 18:02:18 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:56 +0200
commitdc6222611ad14a33f642396558ba84ecba9d6605 (patch)
treed759020233b66be62c5539209a03842d283b67a9 /src/engine/user/cursor.cpp
parentdbab54ebf134b6ab2cf719d7c26a191fbffeed34 (diff)
perf: add noexcept almost everywhere
Diffstat (limited to 'src/engine/user/cursor.cpp')
-rw-r--r--src/engine/user/cursor.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/engine/user/cursor.cpp b/src/engine/user/cursor.cpp
index 663d56a..b02a9bc 100644
--- a/src/engine/user/cursor.cpp
+++ b/src/engine/user/cursor.cpp
@@ -5,7 +5,7 @@
#include <cstdlib>
#include <iostream>
-CursorController::CursorController() : _position({.x = 0, .y = 0}) {}
+CursorController::CursorController() noexcept : _position({.x = 0, .y = 0}) {}
void CursorController::move(const Vector2 &direction, const uint32_t &amount) noexcept
{
@@ -32,12 +32,6 @@ Vector2 CursorController::where() const noexcept
return _position;
}
-void CursorController::hide()
-{
- fmt::print(CURSOR_INVISIBLE, fmt::arg("esc", ESC));
- std::cout.flush();
-}
-
void CursorController::ensure_position() noexcept
{
fmt::print(REQUEST_CURSOR_POSITION, fmt::arg("esc", ESC));
@@ -51,7 +45,13 @@ void CursorController::ensure_position() noexcept
_position = Vector2(vector2_options);
}
-void CursorController::show()
+void CursorController::hide() noexcept
+{
+ fmt::print(CURSOR_INVISIBLE, fmt::arg("esc", ESC));
+ std::cout.flush();
+}
+
+void CursorController::show() noexcept
{
fmt::print(CURSOR_VISIBLE, fmt::arg("esc", ESC));
std::cout.flush();