Skip to content

Commit

Permalink
Merge pull request #63 from YGNI-RType/dev
Browse files Browse the repository at this point in the history
Release v0.3.1
  • Loading branch information
Popochounet authored Nov 3, 2024
2 parents a5c4287 + d66752a commit f067605
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions include/GEngine/libdev/Events.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ using CLINewInput = gengine::system::event::CLINewInput;

namespace geg::event::io {
using KeyPressedEvent = gengine::system::event::driver::input::KeyPressed;
using KeyReleasedEvent = gengine::system::event::driver::input::KeyReleased;
using KeyApostropheEvent = gengine::system::event::driver::input::Key_Apostrophe;
using KeyCommaEvent = gengine::system::event::driver::input::Key_Comma;
using KeyMinusEvent = gengine::system::event::driver::input::Key_Minus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class KeyboardCatcher : public gengine::System<KeyboardCatcher>, public LocalSys
KeyboardKey &operator++(KeyboardKey &key);

using KeyPressedEvent = gengine::system::event::driver::input::KeyPressed;
using KeyReleasedEvent = gengine::system::event::driver::input::KeyReleased;
using KeyApostropheEvent = gengine::system::event::driver::input::Key_Apostrophe;
using KeyCommaEvent = gengine::system::event::driver::input::Key_Comma;
using KeyMinusEvent = gengine::system::event::driver::input::Key_Minus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ class KeyboardKey : public Event {
state_t state;
};

class KeyReleased : public Event {
public:
KeyReleased(int key)
: key(key) {
}
int key;
};

class KeyPressed : public Event {
public:
KeyPressed(int key)
Expand Down
4 changes: 2 additions & 2 deletions install/overlay-ports/gengine/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO YGNI-RType/GEngine
REF v0.2.0
SHA512 658c446a10fb38fa1cf43716a3719267c6ba369d87fa0cb70a02443ab33765871e46a53b13c12534c80c79538bef8fd5d3ee668ec11c238a8188a46da0afafb6
REF v0.3.0
SHA512 9bfe6e1dee2faa8fa78f6350f796d5f57e9be3080d1312cd21773151fab2488e2abd970062bb75332343ed8c758febdbd140b288feac9c130cee68ae869a0a6d
)

vcpkg_cmake_configure(
Expand Down
7 changes: 5 additions & 2 deletions install/overlay-ports/gengine/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gengine",
"version": "0.2.0",
"version": "0.3.0",
"homepage": "https://github.com/YGNI-RType/GEngine",
"description": "An amazing Game Engine.",
"license": "MIT",
Expand All @@ -15,6 +15,9 @@
},
"raylib",
"stduuid",
"nlohmann-json"
"nlohmann-json",
"portaudio",
"opus",
"bzip2"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ void KeyboardCatcher::init(void) {

void KeyboardCatcher::onRenderLoop(gengine::system::event::RenderLoop &e) {
for (KeyboardKey key = KEY_SPACE; key != KEY_NULL; ++key) {
if (IsKeyReleased(key))
if (IsKeyReleased(key)) {
publishEvent(KeyReleasedEvent(key));
processKeyInput(key, InputState::RELEASE);
}
if (IsKeyPressed(key)) {
publishEvent(KeyPressedEvent(key));
processKeyInput(key, InputState::PRESSED);
Expand Down

0 comments on commit f067605

Please sign in to comment.