Skip to content

Commit

Permalink
Update GitHub Actions and the SFML example
Browse files Browse the repository at this point in the history
  • Loading branch information
eXpl0it3r committed Feb 15, 2024
1 parent 0455a60 commit 2a11dcb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@ jobs:
fail-fast: false
matrix:
platform:
- { name: Windows VS2019, os: windows-latest }
- { name: Linux GCC, os: ubuntu-latest }
- { name: Linux Clang, os: ubuntu-latest, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: MacOS XCode, os: macos-latest }
- { name: Windows VS2022, os: windows-2022 }
- { name: Linux GCC, os: ubuntu-22.04 }
- { name: Linux Clang, os: ubuntu-22.04, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: macOS x64, os: macos-14, flags: -DCMAKE_OSX_ARCHITECTURES=x86_64 }
- { name: macOS M1, os: macos-14, flags: -DCMAKE_OSX_ARCHITECTURES=arm64 }

steps:
- name: PubBus - Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: SFML - Install Linux Dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libudev-dev libgl1-mesa-dev libegl1-mesa-dev

- name: SFML - Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: SFML/SFML
path: SFML
Expand Down
4 changes: 2 additions & 2 deletions examples/SFML/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
find_package(SFML 2.5 COMPONENTS graphics REQUIRED)
find_package(SFML 3.0 COMPONENTS graphics REQUIRED)

add_executable(SFML "SFML.cpp" "Messages.hpp")

target_include_directories(SFML PRIVATE "${CMAKE_SOURCE_DIR}/include")
target_link_libraries(SFML sfml-graphics)
target_link_libraries(SFML SFML::Graphics)

if(PUBBUS_INSTALL_EXAMPLE)
install(TARGETS SFML RUNTIME DESTINATION examples)
Expand Down
1 change: 1 addition & 0 deletions examples/SFML/Messages.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ struct KeyMessage : pub::Message

Type type;
sf::Keyboard::Key code;
sf::Keyboard::ScanCode scan;
bool alt;
bool control;
bool shift;
Expand Down
3 changes: 2 additions & 1 deletion examples/SFML/SFML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ButtonText final : public sf::Drawable

int main()
{
sf::RenderWindow window({ 800, 600 }, "PubBus SFML Test");
sf::RenderWindow window(sf::VideoMode{{ 800, 600 }}, "PubBus SFML Test");
window.setFramerateLimit(60);

sf::Font font;
Expand Down Expand Up @@ -134,6 +134,7 @@ int main()
bus.publish(KeyMessage{
.type = event.type == sf::Event::KeyPressed ? KeyMessage::Type::Pressed : KeyMessage::Type::Released,
.code = event.key.code,
.scan = event.key.scan,
.alt = event.key.alt,
.control = event.key.control,
.shift = event.key.shift,
Expand Down

0 comments on commit 2a11dcb

Please sign in to comment.