Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Hapaxia/SelbaWard into sfml3
Browse files Browse the repository at this point in the history
  • Loading branch information
Hapaxia committed Jan 23, 2025
2 parents 8a3718f + c539a5f commit c982fe7
Show file tree
Hide file tree
Showing 18 changed files with 2,570 additions and 173 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

on: [push, pull_request, workflow_dispatch]

concurrency:
group: environment-${{github.ref}}
cancel-in-progress: true

jobs:
build:
name: ${{matrix.platform.name}} ${{matrix.type.name}}
runs-on: ${{matrix.platform.os}}
defaults:
run:
shell: bash

strategy:
fail-fast: false
matrix:
platform:
- { name: Windows MSVC, os: windows-2022 }
- { name: Windows ClangCL, os: windows-2022, flags: -T ClangCL }
- { name: Windows Clang, os: windows-2022, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: Linux GCC, os: ubuntu-22.04, flags: -GNinja }
- { name: Linux Clang, os: ubuntu-22.04, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: macOS, os: macos-12, flags: -GNinja }
type:
- { name: Release }
- { name: Debug }

steps:
- name: Get CMake and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: latest
ninjaVersion: latest

- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install ninja-build llvm xorg-dev libxrandr-dev libxcursor-dev libudev-dev libgl1-mesa-dev libegl1-mesa-dev
- name: Install macOS Tools
if: runner.os == 'macOS'
run: brew install ninja

- name: Checkout SFML
uses: actions/checkout@v3
with:
repository: SFML/SFML
path: sfml
ref: 2.6.0

- name: Configure SFML
run: |
cmake -S sfml -B sfml/build \
-DCMAKE_INSTALL_PREFIX=sfml/install \
-DCMAKE_BUILD_TYPE=${{matrix.type.name}} \
-DSFML_BUILD_AUDIO=OFF \
-DSFML_BUILD_NETWORK=OFF \
${{matrix.platform.flags}}
- name: Build SFML
run: cmake --build sfml/build --config ${{matrix.type.name}} --target install

- name: Checkout SelbaWard
uses: actions/checkout@v3
with:
path: SelbaWard

- name: Configure SelbaWard
run: |
cmake -S SelbaWard -B SelbaWard/build \
-DBUILD_EXAMPLES=ON \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install \
-DCMAKE_BUILD_TYPE=${{matrix.type.name}} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DSFML_ROOT=$GITHUB_WORKSPACE/sfml/install \
${{matrix.platform.flags}}
- name: Build SelbaWard
run: cmake --build SelbaWard/build --config ${{matrix.type.name}}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ backup_*/
test/
test-*/
test_*/
test-*/
temp/
temp_*/
temp_storage/
PropertySheets/
priv_*/

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
39 changes: 39 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
cmake_minimum_required(VERSION 3.16)
project(SelbaWard LANGUAGES CXX)

find_package(SFML 2.6 REQUIRED COMPONENTS graphics)

add_library(SelbaWard
src/SelbaWard/BitmapFont.cpp
src/SelbaWard/BitmapText.cpp
src/SelbaWard/ConsoleScreen.cpp
src/SelbaWard/Crosshair.cpp
src/SelbaWard/ElasticSprite.cpp
src/SelbaWard/GallerySprite.cpp
src/SelbaWard/Line.cpp
src/SelbaWard/NinePatch.cpp
src/SelbaWard/PieChart.cpp
src/SelbaWard/PixelDisplay.cpp
src/SelbaWard/Polygon.cpp
src/SelbaWard/ProgressBar.cpp
src/SelbaWard/Ring.cpp
src/SelbaWard/SpinningCard.cpp
src/SelbaWard/Spline.cpp
src/SelbaWard/Sprite3d.cpp
src/SelbaWard/Starfield.cpp
src/SelbaWard/Starfield3d.cpp
)
add_library(SelbaWard::SelbaWard ALIAS SelbaWard)
target_include_directories(SelbaWard PUBLIC src)
target_link_libraries(SelbaWard PUBLIC sfml-graphics)
target_compile_features(SelbaWard PUBLIC cxx_std_11)

# Stop configuration if being consumed by a higher level project
if(NOT PROJECT_IS_TOP_LEVEL)
return()
endif()

option(BUILD_EXAMPLES "Build examples" OFF)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
26 changes: 26 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
add_executable(bitmap-text bitmapTextExample.cpp)
target_link_libraries(bitmap-text PRIVATE SelbaWard::SelbaWard)

add_executable(line lineExample.cpp)
target_link_libraries(line PRIVATE SelbaWard::SelbaWard)

add_executable(progress-bar progressBarExample.cpp)
target_link_libraries(progress-bar PRIVATE SelbaWard::SelbaWard)

add_executable(spinning-card spinningCardExample.cpp)
target_link_libraries(spinning-card PRIVATE SelbaWard::SelbaWard)

add_executable(spline splineExample.cpp)
target_link_libraries(spline PRIVATE SelbaWard::SelbaWard)

add_executable(spline2 splineExample2.cpp)
target_link_libraries(spline2 PRIVATE SelbaWard::SelbaWard)

add_executable(sprite3d sprite3dExample.cpp)
target_link_libraries(sprite3d PRIVATE SelbaWard::SelbaWard)

add_executable(sprite3d-card-fan sprite3dExampleCardFan.cpp)
target_link_libraries(sprite3d-card-fan PRIVATE SelbaWard::SelbaWard)

add_executable(sprite3d-spinning-card sprite3dExampleSpinningCard.cpp)
target_link_libraries(sprite3d-spinning-card PRIVATE SelbaWard::SelbaWard)
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
A collection of SFML drawables
by [Hapaxia](http://github.com/Hapaxia)

Contents: **Bitmap Text**, **Console Screen**, **Crosshair**, **Elastic Sprite**, **Gallery Sprite**, **Line**, **Nine Patch**, **Pie Chart**, **Pixel Display**, **Polygon**, **Progress Bar**, **Ring**, **Spinning Card**, **Spline**, **Sprite 3D**, **Starfield**, **Tile Map**
Contents: **Bitmap Text**, **Console Screen**, **Crosshair**, **Elastic Sprite**, **Frame Transition**, **Gallery Sprite**, **Line**, **Nine Patch**, **Pie Chart**, **Pixel Display**, **Polygon**, **Progress Bar**, **Ring**, **Spinning Card**, **Spline**, **Sprite 3D**, **Sprite Batch**, **Starfield**, **Starfield 3D**, **Tile Map**

## For information, view the [Wiki].

Expand Down
3 changes: 3 additions & 0 deletions src/SelbaWard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "SelbaWard/ConsoleScreen.hpp"
#include "SelbaWard/Crosshair.hpp"
#include "SelbaWard/ElasticSprite.hpp"
#include "SelbaWard/FrameTransition.hpp"
#include "SelbaWard/GallerySprite.hpp"
#include "SelbaWard/Line.hpp"
#include "SelbaWard/NinePatch.hpp"
Expand All @@ -46,7 +47,9 @@
#include "SelbaWard/SpinningCard.hpp"
#include "SelbaWard/Spline.hpp"
#include "SelbaWard/Sprite3d.hpp"
#include "SelbaWard/SpriteBatch.hpp"
#include "SelbaWard/Starfield.hpp"
#include "SelbaWard/Starfield3d.hpp"
#include "SelbaWard/TileMap.hpp"

#endif // SELBAWARD_HPP
Loading

0 comments on commit c982fe7

Please sign in to comment.