12 changed files with 621 additions and 564 deletions

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ Checks: >
-cppcoreguidelines-pro-type-const-cast, -cppcoreguidelines-pro-type-const-cast,
-cppcoreguidelines-pro-type-reinterpret-cast, -cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-special-member-functions, -cppcoreguidelines-special-member-functions,
-cppcoreguidelines-use-enum-class,
-modernize-avoid-c-arrays, -modernize-avoid-c-arrays,
-modernize-macro-to-enum, -modernize-macro-to-enum,
-modernize-redundant-void-arg, -modernize-redundant-void-arg,
+20 -7
View File
@@ -7,7 +7,7 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
env: env:
SFML_VERSION: 3.0.0 SFML_VERSION: 3.0.1
defaults: defaults:
run: run:
@@ -22,10 +22,10 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
platform: platform:
- { name: Windows VS2022 x86, os: windows-2022, flags: -AWin32 } - { name: Windows VS2022 x86, os: windows-2025, flags: -AWin32 }
- { name: Windows VS2022 x64, os: windows-2022, flags: -Ax64 } - { name: Windows VS2022 x64, os: windows-2025, flags: -Ax64 }
- { name: Windows ClangCL, os: windows-2022, flags: -T ClangCL } - { name: Windows ClangCL, os: windows-2025, flags: -T ClangCL }
- { name: Windows Clang, os: windows-2022, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ } - { name: Windows Clang, os: windows-2025, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: Linux GCC, os: ubuntu-22.04, flags: -GNinja } - { 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: Linux Clang, os: ubuntu-22.04, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: MacOS, os: macos-14, flags: -GNinja } - { name: MacOS, os: macos-14, flags: -GNinja }
@@ -55,7 +55,12 @@ jobs:
path: SFML path: SFML
- name: Configure SFML CMake - name: Configure SFML CMake
run: cmake -S SFML -B SFML/build -DCMAKE_INSTALL_PREFIX=SFML/install ${{matrix.platform.flags}} ${{matrix.config.flags}} -DCMAKE_BUILD_TYPE=${{matrix.type.name}} run: |
cmake -S SFML -B SFML/build \
-DCMAKE_BUILD_TYPE=${{matrix.type.name}} \
-DCMAKE_INSTALL_PREFIX=SFML/install \
${{matrix.platform.flags}} \
${{matrix.config.flags}}
- name: Build SFML - name: Build SFML
run: cmake --build SFML/build --config ${{matrix.type.name}} --target install run: cmake --build SFML/build --config ${{matrix.type.name}} --target install
@@ -66,7 +71,15 @@ jobs:
path: CSFML path: CSFML
- name: Configure CSFML CMake - name: Configure CSFML CMake
run: cmake --preset dev -S CSFML -B CSFML/build -DCMAKE_INSTALL_PREFIX=CSFML/install -DSFML_ROOT=SFML/install -DCMAKE_VERBOSE_MAKEFILE=ON ${{matrix.platform.flags}} ${{matrix.config.flags}} ${{matrix.config.csfml_flags}} -DCMAKE_BUILD_TYPE=${{matrix.type.name}} run: |
cmake --preset dev -S CSFML -B CSFML/build \
-DCMAKE_BUILD_TYPE=${{matrix.type.name}} \
-DCMAKE_INSTALL_PREFIX=CSFML/install \
-DSFML_ROOT=SFML/install \
-DCMAKE_VERBOSE_MAKEFILE=ON \
${{matrix.platform.flags}} \
${{matrix.config.flags}} \
${{matrix.config.csfml_flags}}
- name: Build CSFML - name: Build CSFML
run: cmake --build CSFML/build --config ${{matrix.type.name}} --target install run: cmake --build CSFML/build --config ${{matrix.type.name}} --target install
+197 -215
View File
@@ -1,252 +1,234 @@
name: NuGet Release name: NuGet Release
on: on:
push: push:
branches: branches:
- master - master
- 2.6.x - 2.6.x
workflow_dispatch: {} tags:
- "**"
workflow_dispatch: {}
concurrency: concurrency:
group: nuget-${{github.ref}} group: nuget-${{github.ref}}
cancel-in-progress: true cancel-in-progress: true
env: env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs: jobs:
windows: windows:
name: Windows VS2022 name: Windows VS2022
runs-on: windows-2022 runs-on: windows-2025
steps: steps:
- name: Checkout CSFML - name: Checkout CSFML
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
path: CSFML path: CSFML
- name: Build x86 - name: Build x86
shell: pwsh shell: pwsh
run: | run: |
cd CSFML/tools/nuget cd CSFML/tools/nuget
./build.win.ps1 "win-x86" ./build.win.ps1 "win-x86"
- name: Build x64 - name: Build x64
shell: pwsh shell: pwsh
run: | run: |
cd CSFML/tools/nuget cd CSFML/tools/nuget
./build.win.ps1 "win-x64" ./build.win.ps1 "win-x64"
- name: Upload Artifact - name: Build ARM64
uses: actions/upload-artifact@v4 shell: pwsh
with: run: |
name: CSFML-win-x86-x64 cd CSFML/tools/nuget
path: CSFML/tools/nuget/CSFML/runtimes ./build.win.ps1 "win-arm64"
linux-x64: - name: Upload Artifact
name: Linux x64 uses: actions/upload-artifact@v4
runs-on: ubuntu-22.04 with:
container: name: CSFML-win-x86-x64-arm64
image: ubuntu:22.04 path: CSFML/tools/nuget/CSFML/runtimes
steps: linux-x64:
- name: Checkout CSFML name: Linux x64
uses: actions/checkout@v4 runs-on: ubuntu-22.04
with: container:
path: CSFML image: ubuntu:22.04
- name: Build steps:
shell: bash - name: Checkout CSFML
run: | uses: actions/checkout@v4
cd ./CSFML/tools/nuget with:
chmod +x ./docker.linux-x64.sh path: CSFML
./docker.linux-x64.sh
- name: Upload Artifact - name: Build
uses: actions/upload-artifact@v4 shell: bash
with: run: |
name: CSFML-linux-x64 cd ./CSFML/tools/nuget
path: CSFML/tools/nuget/CSFML/runtimes chmod +x ./docker.linux-x64.sh
./docker.linux-x64.sh
linux-arm: - name: Upload Artifact
name: Linux ARM uses: actions/upload-artifact@v4
runs-on: ubuntu-22.04 with:
name: CSFML-linux-x64
path: CSFML/tools/nuget/CSFML/runtimes
steps: linux-arm:
- name: Checkout CSFML name: Linux ARM
uses: actions/checkout@v4 runs-on: ubuntu-22.04
with:
path: CSFML
- name: Build in an ARM container steps:
uses: uraimo/run-on-arch-action@v2.8.1 - name: Checkout CSFML
with: uses: actions/checkout@v4
arch: armv7 with:
distro: ubuntu22.04 path: CSFML
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}/CSFML:/CSFML"
install: |
apt-get update -y
apt-get install -y git libfreetype6-dev xorg-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libgl1-mesa-dev libflac-dev libogg-dev libvorbis-dev cmake g++
run: |
cd /CSFML/tools/nuget
chmod +x ./build.linux.sh
./build.linux.sh linux-arm
- name: Upload Artifact - name: Build in an ARM container
uses: actions/upload-artifact@v4 uses: uraimo/run-on-arch-action@v3.0.1
with: with:
name: CSFML-linux-arm arch: armv7
path: CSFML/tools/nuget/CSFML/runtimes distro: ubuntu22.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}/CSFML:/CSFML"
install: |
apt-get update -y
apt-get install -y git libfreetype6-dev xorg-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libgl1-mesa-dev libflac-dev libogg-dev libvorbis-dev cmake g++
run: |
cd /CSFML/tools/nuget
chmod +x ./build.linux.sh
./build.linux.sh linux-arm
linux-arm64: - name: Upload Artifact
name: Linux ARM64 uses: actions/upload-artifact@v4
runs-on: ubuntu-22.04 with:
name: CSFML-linux-arm
path: CSFML/tools/nuget/CSFML/runtimes
steps: linux-arm64:
- name: Checkout CSFML name: Linux ARM64
uses: actions/checkout@v4 runs-on: ubuntu-22.04
with:
path: CSFML
- name: Build in an ARM64 container steps:
uses: uraimo/run-on-arch-action@v2.8.1 - name: Checkout CSFML
with: uses: actions/checkout@v4
arch: aarch64 with:
distro: ubuntu22.04 path: CSFML
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}/CSFML:/CSFML"
install: |
apt-get update -y
apt-get install -y git libfreetype6-dev xorg-dev libxrandr-dev libxcursor-dev libudev-dev libgl1-mesa-dev libflac-dev libogg-dev libvorbis-dev cmake g++
run: |
cd /CSFML/tools/nuget
chmod +x ./build.linux.sh
./build.linux.sh linux-arm64
- name: Upload Artifact - name: Build in an ARM64 container
uses: actions/upload-artifact@v4 uses: uraimo/run-on-arch-action@v3.0.1
with: with:
name: CSFML-linux-arm64 arch: aarch64
path: CSFML/tools/nuget/CSFML/runtimes distro: ubuntu22.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}/CSFML:/CSFML"
install: |
apt-get update -y
apt-get install -y git libfreetype6-dev xorg-dev libxrandr-dev libxcursor-dev libudev-dev libgl1-mesa-dev libflac-dev libogg-dev libvorbis-dev cmake g++
run: |
cd /CSFML/tools/nuget
chmod +x ./build.linux.sh
./build.linux.sh linux-arm64
linux-musl-x64: - name: Upload Artifact
name: Linux MUSL x64 uses: actions/upload-artifact@v4
runs-on: ubuntu-22.04 with:
container: name: CSFML-linux-arm64
image: alpine:3.20.3 path: CSFML/tools/nuget/CSFML/runtimes
steps: linux-musl-x64:
- name: Checkout CSFML name: Linux MUSL x64
uses: actions/checkout@v4 runs-on: ubuntu-22.04
with: container:
path: CSFML image: alpine:3.20.7
- name: Build steps:
shell: sh - name: Checkout CSFML
run: | uses: actions/checkout@v4
cd ./CSFML/tools/nuget with:
chmod +x ./docker.linux-musl-x64.sh path: CSFML
./docker.linux-musl-x64.sh
- name: Upload Artifact - name: Build
uses: actions/upload-artifact@v4 shell: sh
with: run: |
name: CSFML-linux-musl-x64 cd ./CSFML/tools/nuget
path: CSFML/tools/nuget/CSFML/runtimes chmod +x ./docker.linux-musl-x64.sh
./docker.linux-musl-x64.sh
fedora-x64: - name: Upload Artifact
name: Fedora x64 uses: actions/upload-artifact@v4
runs-on: ubuntu-22.04 with:
container: name: CSFML-linux-musl-x64
image: fedora:37 path: CSFML/tools/nuget/CSFML/runtimes
steps: macos:
- name: Checkout CSFML name: macOS
uses: actions/checkout@v4 runs-on: macos-14
with:
path: CSFML
- name: Build steps:
shell: bash - name: Checkout CSFML
run: | uses: actions/checkout@v4
cd ./CSFML/tools/nuget with:
chmod +x ./docker.fedora-x64.sh path: CSFML
./docker.fedora-x64.sh
- name: Upload Artifact - name: Install necessary tooling
uses: actions/upload-artifact@v4 run: brew install coreutils
with:
name: CSFML-fedora-x64
path: CSFML/tools/nuget/CSFML/runtimes
macos: - name: Build x64
name: macOS run: |
runs-on: macos-14 cd CSFML/tools/nuget
./build.macos.sh "osx-x64"
steps: - name: Build ARM64
- name: Checkout CSFML run: |
uses: actions/checkout@v4 cd CSFML/tools/nuget
with: ./build.macos.sh "osx-arm64"
path: CSFML
- name: Install necessary tooling - name: Upload Artifact
run: brew install coreutils uses: actions/upload-artifact@v4
with:
name: CSFML-macOS-x64-arm64
path: CSFML/tools/nuget/CSFML/runtimes
- name: Build x64 package:
run: | name: Package Builds
cd CSFML/tools/nuget runs-on: ubuntu-24.04
./build.macos.sh "osx-x64" needs:
- windows
- name: Build ARM64 - linux-x64
run: | - linux-arm
cd CSFML/tools/nuget - linux-arm64
./build.macos.sh "osx-arm64" - linux-musl-x64
- macos
- name: Upload Artifact steps:
uses: actions/upload-artifact@v4 - name: Checkout CSFML
with: uses: actions/checkout@v4
name: CSFML-macOS-x64-arm64 with:
path: CSFML/tools/nuget/CSFML/runtimes path: CSFML
- name: Download Artifacts
package: uses: actions/download-artifact@v4
name: Package Builds with:
runs-on: ubuntu-22.04 path: CSFML/tools/nuget/CSFML/runtimes
needs: merge-multiple: true
- windows - name: Setup .NET 8 SDK
- linux-x64 id: setup-dotnet
- linux-arm uses: actions/setup-dotnet@v4
- linux-arm64 with:
- linux-musl-x64 dotnet-version: 8.0.x
- fedora-x64 - name: Enforce SDK Version
- macos run: dotnet new globaljson --sdk-version ${{ steps.setup-dotnet.outputs.dotnet-version }} --force
steps: - name: Verify SDK Installation
- name: Checkout CSFML run: dotnet --info
uses: actions/checkout@v4 - name: Build NuGet Package
with: run: |
path: CSFML cd CSFML/tools/nuget
- name: Download Artifacts dotnet build --configuration Release --verbosity detailed
uses: actions/download-artifact@v4 - name: Upload NuGet Package
with: uses: actions/upload-artifact@v4
path: CSFML/tools/nuget/CSFML/runtimes with:
merge-multiple: true name: CSFML-NuGet-Package
- name: Setup .NET 8 SDK path: CSFML/tools/nuget/CSFML/bin/Release/*.nupkg
id: setup-dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Enforce SDK Version
run: dotnet new globaljson --sdk-version ${{ steps.setup-dotnet.outputs.dotnet-version }} --force
- name: Verify SDK Installation
run: dotnet --info
- name: Build NuGet Package
run: |
cd CSFML/tools/nuget
dotnet build --configuration Release --verbosity detailed
- name: Upload NuGet Package
uses: actions/upload-artifact@v4
with:
name: CSFML-NuGet-Package
path: CSFML/tools/nuget/CSFML/bin/Release/*.nupkg
+314 -272
View File
@@ -1,314 +1,356 @@
name: Release Builds name: Release Builds
on: on:
push: push:
branches: branches:
- master - master
- 2.6.x - 2.6.x
tags: tags:
- "**" - "**"
workflow_dispatch: {} workflow_dispatch: {}
concurrency: concurrency:
group: release-${{github.ref}} group: release-${{github.ref}}
cancel-in-progress: true cancel-in-progress: true
env:
SFML_VERSION: 3.0.1
jobs: jobs:
windows-x86: windows-x86:
name: Windows x86 name: Windows x86
runs-on: windows-2022 runs-on: windows-2025
steps: steps:
- name: Cache MinGW x86 - name: Cache MinGW x86
id: mingw-x86-cache id: mingw-x86-cache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ${{ github.workspace }}/mingw32 path: ${{ github.workspace }}/mingw32
key: 14.2.0posix-19.1.1-12.0.0-ucrt-r2-x86 key: 15.2.0posix-13.0.0-ucrt-r1-x86
- name: Install MinGW x86 - name: Install MinGW x86
if: steps.mingw-x86-cache.outputs.cache-hit != 'true' if: steps.mingw-x86-cache.outputs.cache-hit != 'true'
uses: bwoodsend/setup-winlibs-action@v1 uses: bwoodsend/setup-winlibs-action@v1
id: winlibs-32 id: winlibs-32
with: with:
tag: 14.2.0posix-19.1.1-12.0.0-ucrt-r2 tag: 15.2.0posix-13.0.0-ucrt-r1
with_clang: false with_clang: false
architecture: 32 architecture: 32
destination: ${{ github.workspace }} destination: ${{ github.workspace }}
add_to_path: false add_to_path: false
- name: Checkout SFML - name: Checkout SFML
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
repository: SFML/SFML repository: SFML/SFML
ref: 3.0.0 ref: ${{ env.SFML_VERSION }}
path: SFML path: SFML
- name: Checkout CSFML - name: Checkout CSFML
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
path: CSFML path: CSFML
- name: Build SFML - name: Build SFML
run: | run: |
cmake -S SFML -B SFML-build -A Win32 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install -DCMAKE_VERBOSE_MAKEFILE=ON cmake -S SFML -B SFML-build -A Win32 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build SFML-build --config Release --target install cmake --build SFML-build --config Release --target install
- name: Build CSFML - name: Build CSFML
run: | run: |
cmake -S CSFML -B CSFML-build -A Win32 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DCSFML_LINK_SFML_STATICALLY=OFF -DCMAKE_BUILD_TYPE=Release -DSFML_ROOT=${{ github.workspace }}/SFML-install -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install -DCMAKE_VERBOSE_MAKEFILE=ON cmake -S CSFML -B CSFML-build -A Win32 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DCSFML_LINK_SFML_STATICALLY=OFF -DCMAKE_BUILD_TYPE=Release -DSFML_ROOT=${{ github.workspace }}/SFML-install -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build CSFML-build --config Release --target install cmake --build CSFML-build --config Release --target install
- name: Add MinGW to PATH
shell: bash
run: echo "${{ github.workspace }}\mingw32\bin" >> $GITHUB_PATH
- name: Generate Import Libs for MinGW - name: Add MinGW to PATH
shell: pwsh shell: bash
run: | run: echo "${{ github.workspace }}\mingw32\bin" >> $GITHUB_PATH
New-Item -ItemType "directory" -PATH "CSFML-install\lib\gcc"
New-Item -ItemType "directory" -PATH "CSFML-install\lib\msvc"
Move-Item -Path "CSFML-install\lib\*.lib" -Destination "CSFML-install\lib\msvc"
Push-Location CSFML-install\lib\gcc - name: Generate Import Libs for MinGW
& gendef.exe "..\..\bin\csfml-graphics-3.dll" shell: pwsh
& dlltool.exe -d "csfml-graphics-3.def" -D "..\..\bin\csfml-graphics-3.dll" -l "libcsfml-graphics.a" run: |
Remove-Item -Path "csfml-graphics-3.def" New-Item -ItemType "directory" -PATH "CSFML-install\lib\gcc"
New-Item -ItemType "directory" -PATH "CSFML-install\lib\msvc"
& gendef.exe "..\..\bin\csfml-window-3.dll" Move-Item -Path "CSFML-install\lib\*.lib" -Destination "CSFML-install\lib\msvc"
& dlltool.exe -d "csfml-window-3.def" -D "..\..\bin\csfml-window-3.dll" -l "libcsfml-window.a"
Remove-Item -Path "csfml-window-3.def"
& gendef.exe "..\..\bin\csfml-audio-3.dll"
& dlltool.exe -d "csfml-audio-3.def" -D "..\..\bin\csfml-audio-3.dll" -l "libcsfml-audio.a"
Remove-Item -Path "csfml-audio-3.def"
& gendef.exe "..\..\bin\csfml-network-3.dll"
& dlltool.exe -d "csfml-network-3.def" -D "..\..\bin\csfml-network-3.dll" -l "libcsfml-network.a"
Remove-Item -Path "csfml-network-3.def"
& gendef.exe "..\..\bin\csfml-system-3.dll"
& dlltool.exe -d "csfml-system-3.def" -D "..\..\bin\csfml-system-3.dll" -l "libcsfml-system.a"
Remove-Item -Path "csfml-system-3.def"
Pop-Location
New-Item -ItemType "directory" -PATH "install\CSFML" Push-Location CSFML-install\lib\gcc
Move-Item -Path "CSFML-install\*" -Destination "install\CSFML" & gendef.exe "..\..\bin\csfml-graphics-3.dll"
& dlltool.exe -d "csfml-graphics-3.def" -D "..\..\bin\csfml-graphics-3.dll" -l "libcsfml-graphics.a"
Remove-Item -Path "csfml-graphics-3.def"
- name: Upload Artifact & gendef.exe "..\..\bin\csfml-window-3.dll"
uses: actions/upload-artifact@v4 & dlltool.exe -d "csfml-window-3.def" -D "..\..\bin\csfml-window-3.dll" -l "libcsfml-window.a"
with: Remove-Item -Path "csfml-window-3.def"
name: CSFML-windows-32-bit
path: install/CSFML
windows-x64: & gendef.exe "..\..\bin\csfml-audio-3.dll"
name: Windows x64 & dlltool.exe -d "csfml-audio-3.def" -D "..\..\bin\csfml-audio-3.dll" -l "libcsfml-audio.a"
runs-on: windows-2022 Remove-Item -Path "csfml-audio-3.def"
steps: & gendef.exe "..\..\bin\csfml-network-3.dll"
- name: Cache MinGW x64 & dlltool.exe -d "csfml-network-3.def" -D "..\..\bin\csfml-network-3.dll" -l "libcsfml-network.a"
id: mingw-x64-cache Remove-Item -Path "csfml-network-3.def"
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/mingw64
key: 14.2.0posix-19.1.1-12.0.0-ucrt-r2-x64
- name: Install MinGW x64 & gendef.exe "..\..\bin\csfml-system-3.dll"
if: steps.mingw-x64-cache.outputs.cache-hit != 'true' & dlltool.exe -d "csfml-system-3.def" -D "..\..\bin\csfml-system-3.dll" -l "libcsfml-system.a"
uses: bwoodsend/setup-winlibs-action@v1 Remove-Item -Path "csfml-system-3.def"
id: winlibs-64 Pop-Location
with:
tag: 14.2.0posix-19.1.1-12.0.0-ucrt-r2
with_clang: false
architecture: 64
destination: ${{ github.workspace }}
add_to_path: false
- name: Checkout SFML New-Item -ItemType "directory" -PATH "install\CSFML"
uses: actions/checkout@v4 Move-Item -Path "CSFML-install\*" -Destination "install\CSFML"
with:
repository: SFML/SFML
ref: 3.0.0
path: SFML
- name: Checkout CSFML - name: Upload Artifact
uses: actions/checkout@v4 uses: actions/upload-artifact@v4
with: with:
path: CSFML name: CSFML-windows-32-bit
path: install/CSFML
- name: Build SFML windows-x64:
run: | name: Windows x64
cmake -S SFML -B SFML-build -A x64 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install -DCMAKE_VERBOSE_MAKEFILE=ON runs-on: windows-2025
cmake --build SFML-build --config Release --target install
- name: Build CSFML steps:
run: | - name: Cache MinGW x64
cmake -S CSFML -B CSFML-build -A x64 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DCSFML_LINK_SFML_STATICALLY=OFF -DCMAKE_BUILD_TYPE=Release -DSFML_ROOT=${{ github.workspace }}/SFML-install -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install -DCMAKE_VERBOSE_MAKEFILE=ON id: mingw-x64-cache
cmake --build CSFML-build --config Release --target install uses: actions/cache@v4
with:
path: ${{ github.workspace }}/mingw64
key: 15.2.0posix-13.0.0-ucrt-r1-x64
- name: Add MinGW to PATH - name: Install MinGW x64
shell: bash if: steps.mingw-x64-cache.outputs.cache-hit != 'true'
run: echo "${{ github.workspace }}\mingw64\bin" >> $GITHUB_PATH uses: bwoodsend/setup-winlibs-action@v1
id: winlibs-64
with:
tag: 15.2.0posix-13.0.0-ucrt-r1
with_clang: false
architecture: 64
destination: ${{ github.workspace }}
add_to_path: false
- name: Generate Import Libs for MinGW - name: Checkout SFML
shell: pwsh uses: actions/checkout@v4
run: | with:
New-Item -ItemType "directory" -PATH "CSFML-install\lib\gcc" repository: SFML/SFML
New-Item -ItemType "directory" -PATH "CSFML-install\lib\msvc" ref: ${{ env.SFML_VERSION }}
Move-Item -Path "CSFML-install\lib\*.lib" -Destination "CSFML-install\lib\msvc" path: SFML
Push-Location CSFML-install\lib\gcc - name: Checkout CSFML
& gendef.exe "..\..\bin\csfml-graphics-3.dll" uses: actions/checkout@v4
& dlltool.exe -d "csfml-graphics-3.def" -D "..\..\bin\csfml-graphics-3.dll" -l "libcsfml-graphics.a" with:
Remove-Item -Path "csfml-graphics-3.def" path: CSFML
& gendef.exe "..\..\bin\csfml-window-3.dll"
& dlltool.exe -d "csfml-window-3.def" -D "..\..\bin\csfml-window-3.dll" -l "libcsfml-window.a"
Remove-Item -Path "csfml-window-3.def"
& gendef.exe "..\..\bin\csfml-audio-3.dll"
& dlltool.exe -d "csfml-audio-3.def" -D "..\..\bin\csfml-audio-3.dll" -l "libcsfml-audio.a"
Remove-Item -Path "csfml-audio-3.def"
& gendef.exe "..\..\bin\csfml-network-3.dll"
& dlltool.exe -d "csfml-network-3.def" -D "..\..\bin\csfml-network-3.dll" -l "libcsfml-network.a"
Remove-Item -Path "csfml-network-3.def"
& gendef.exe "..\..\bin\csfml-system-3.dll"
& dlltool.exe -d "csfml-system-3.def" -D "..\..\bin\csfml-system-3.dll" -l "libcsfml-system.a"
Remove-Item -Path "csfml-system-3.def"
Pop-Location
New-Item -ItemType "directory" -PATH "install\CSFML" - name: Build SFML
Move-Item -Path "CSFML-install\*" -Destination "install\CSFML" run: |
cmake -S SFML -B SFML-build -A x64 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build SFML-build --config Release --target install
- name: Upload Artifact - name: Build CSFML
uses: actions/upload-artifact@v4 run: |
with: cmake -S CSFML -B CSFML-build -A x64 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DCSFML_LINK_SFML_STATICALLY=OFF -DCMAKE_BUILD_TYPE=Release -DSFML_ROOT=${{ github.workspace }}/SFML-install -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
name: CSFML-windows-64-bit cmake --build CSFML-build --config Release --target install
path: install/CSFML
macos-x64: - name: Add MinGW to PATH
name: macOS x64 shell: bash
runs-on: macos-13 run: echo "${{ github.workspace }}\mingw64\bin" >> $GITHUB_PATH
steps: - name: Generate Import Libs for MinGW
- name: Checkout SFML shell: pwsh
uses: actions/checkout@v4 run: |
with: New-Item -ItemType "directory" -PATH "CSFML-install\lib\gcc"
repository: SFML/SFML New-Item -ItemType "directory" -PATH "CSFML-install\lib\msvc"
ref: 3.0.0 Move-Item -Path "CSFML-install\lib\*.lib" -Destination "CSFML-install\lib\msvc"
path: SFML
- name: Checkout CSFML Push-Location CSFML-install\lib\gcc
uses: actions/checkout@v4 & gendef.exe "..\..\bin\csfml-graphics-3.dll"
with: & dlltool.exe -d "csfml-graphics-3.def" -D "..\..\bin\csfml-graphics-3.dll" -l "libcsfml-graphics.a"
path: CSFML Remove-Item -Path "csfml-graphics-3.def"
- name: Build SFML & gendef.exe "..\..\bin\csfml-window-3.dll"
run: | & dlltool.exe -d "csfml-window-3.def" -D "..\..\bin\csfml-window-3.dll" -l "libcsfml-window.a"
cmake -S SFML -B SFML-build -G "Unix Makefiles" \ Remove-Item -Path "csfml-window-3.def"
-DCMAKE_C_COMPILER="/usr/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/bin/clang++" \
-DCMAKE_C_FLAGS="-stdlib=libc++" \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
-DSFML_BUILD_FRAMEWORKS=OFF \
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build SFML-build --config Release --target install
- name: Build CSFML & gendef.exe "..\..\bin\csfml-audio-3.dll"
run: | & dlltool.exe -d "csfml-audio-3.def" -D "..\..\bin\csfml-audio-3.dll" -l "libcsfml-audio.a"
cmake -S CSFML -B CSFML-build -G "Unix Makefiles" \ Remove-Item -Path "csfml-audio-3.def"
-DCMAKE_C_COMPILER="/usr/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/bin/clang++" \
-DCMAKE_C_FLAGS="-stdlib=libc++" \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
-DSFML_ROOT=${{ github.workspace }}/SFML-install \
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build CSFML-build --config Release --target install
- name: Create Archive & gendef.exe "..\..\bin\csfml-network-3.dll"
run: | & dlltool.exe -d "csfml-network-3.def" -D "..\..\bin\csfml-network-3.dll" -l "libcsfml-network.a"
mkdir CSFML-macOS-clang-64-bit Remove-Item -Path "csfml-network-3.def"
cp -R CSFML-install/include CSFML-macOS-clang-64-bit
cp -R CSFML-install/lib CSFML-macOS-clang-64-bit
cp CSFML-install/share/CSFML/* CSFML-macOS-clang-64-bit
tar -zcvf CSFML-macOS-clang-64-bit.tar.gz CSFML-macOS-clang-64-bit
- name: Upload Artifact & gendef.exe "..\..\bin\csfml-system-3.dll"
uses: actions/upload-artifact@v4 & dlltool.exe -d "csfml-system-3.def" -D "..\..\bin\csfml-system-3.dll" -l "libcsfml-system.a"
with: Remove-Item -Path "csfml-system-3.def"
name: CSFML-macOS-clang-64-bit Pop-Location
path: CSFML-macOS-clang-64-bit.tar.gz
macos-arm64: New-Item -ItemType "directory" -PATH "install\CSFML"
name: macOS ARM64 Move-Item -Path "CSFML-install\*" -Destination "install\CSFML"
runs-on: macos-14
steps: - name: Upload Artifact
- name: Checkout SFML uses: actions/upload-artifact@v4
uses: actions/checkout@v4 with:
with: name: CSFML-windows-64-bit
repository: SFML/SFML path: install/CSFML
ref: 3.0.0
path: SFML
- name: Checkout CSFML windows-arm64:
uses: actions/checkout@v4 name: Windows ARM64
with: runs-on: windows-2025
path: CSFML
- name: Build SFML
run: |
cmake -S SFML -B SFML-build -G "Unix Makefiles" \
-DCMAKE_C_COMPILER="/usr/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/bin/clang++" \
-DCMAKE_C_FLAGS="-stdlib=libc++" \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-DSFML_BUILD_FRAMEWORKS=OFF \
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build SFML-build --config Release --target install
- name: Build CSFML steps:
run: | - name: Checkout SFML
cmake -S CSFML -B CSFML-build -G "Unix Makefiles" \ uses: actions/checkout@v4
-DCMAKE_C_COMPILER="/usr/bin/clang" \ with:
-DCMAKE_CXX_COMPILER="/usr/bin/clang++" \ repository: SFML/SFML
-DCMAKE_C_FLAGS="-stdlib=libc++" \ ref: ${{ env.SFML_VERSION }}
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \ path: SFML
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-DSFML_ROOT=${{ github.workspace }}/SFML-install \
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build CSFML-build --config Release --target install
- name: Create Archive - name: Checkout CSFML
run: | uses: actions/checkout@v4
mkdir CSFML-macOS-clang-arm64 with:
cp -R CSFML-install/include CSFML-macOS-clang-arm64 path: CSFML
cp -R CSFML-install/lib CSFML-macOS-clang-arm64
cp CSFML-install/share/CSFML/* CSFML-macOS-clang-arm64
tar -zcvf CSFML-macOS-clang-arm64.tar.gz CSFML-macOS-clang-arm64
- name: Upload Artifact - name: Build SFML
uses: actions/upload-artifact@v4 run: |
with: cmake -S SFML -B SFML-build -A ARM64 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
name: CSFML-macOS-clang-arm64 cmake --build SFML-build --config Release --target install
path: CSFML-macOS-clang-arm64.tar.gz
- name: Build CSFML
run: |
cmake -S CSFML -B CSFML-build -A ARM64 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DCSFML_LINK_SFML_STATICALLY=OFF -DCMAKE_BUILD_TYPE=Release -DSFML_ROOT=${{ github.workspace }}/SFML-install -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build CSFML-build --config Release --target install
- name: Move Files
shell: pwsh
run: |
New-Item -ItemType "directory" -PATH "install\CSFML"
Move-Item -Path "CSFML-install\*" -Destination "install\CSFML"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: CSFML-windows-arm64
path: install/CSFML
macos-x64:
name: macOS x64
runs-on: macos-13
steps:
- name: Checkout SFML
uses: actions/checkout@v4
with:
repository: SFML/SFML
ref: ${{ env.SFML_VERSION }}
path: SFML
- name: Checkout CSFML
uses: actions/checkout@v4
with:
path: CSFML
- name: Build SFML
run: |
cmake -S SFML -B SFML-build -G "Unix Makefiles" \
-DCMAKE_C_COMPILER="/usr/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/bin/clang++" \
-DCMAKE_C_FLAGS="-stdlib=libc++" \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
-DSFML_BUILD_FRAMEWORKS=OFF \
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build SFML-build --config Release --target install
- name: Build CSFML
run: |
cmake -S CSFML -B CSFML-build -G "Unix Makefiles" \
-DCMAKE_C_COMPILER="/usr/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/bin/clang++" \
-DCMAKE_C_FLAGS="-stdlib=libc++" \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
-DSFML_ROOT=${{ github.workspace }}/SFML-install \
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build CSFML-build --config Release --target install
- name: Create Archive
run: |
mkdir CSFML-macOS-clang-64-bit
cp -R CSFML-install/include CSFML-macOS-clang-64-bit
cp -R CSFML-install/lib CSFML-macOS-clang-64-bit
cp CSFML-install/share/CSFML/* CSFML-macOS-clang-64-bit
tar -zcvf CSFML-macOS-clang-64-bit.tar.gz CSFML-macOS-clang-64-bit
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: CSFML-macOS-clang-64-bit
path: CSFML-macOS-clang-64-bit.tar.gz
macos-arm64:
name: macOS ARM64
runs-on: macos-14
steps:
- name: Checkout SFML
uses: actions/checkout@v4
with:
repository: SFML/SFML
ref: ${{ env.SFML_VERSION }}
path: SFML
- name: Checkout CSFML
uses: actions/checkout@v4
with:
path: CSFML
- name: Build SFML
run: |
cmake -S SFML -B SFML-build -G "Unix Makefiles" \
-DCMAKE_C_COMPILER="/usr/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/bin/clang++" \
-DCMAKE_C_FLAGS="-stdlib=libc++" \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-DSFML_BUILD_FRAMEWORKS=OFF \
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build SFML-build --config Release --target install
- name: Build CSFML
run: |
cmake -S CSFML -B CSFML-build -G "Unix Makefiles" \
-DCMAKE_C_COMPILER="/usr/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/bin/clang++" \
-DCMAKE_C_FLAGS="-stdlib=libc++" \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-DSFML_ROOT=${{ github.workspace }}/SFML-install \
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build CSFML-build --config Release --target install
- name: Create Archive
run: |
mkdir CSFML-macOS-clang-arm64
cp -R CSFML-install/include CSFML-macOS-clang-arm64
cp -R CSFML-install/lib CSFML-macOS-clang-arm64
cp CSFML-install/share/CSFML/* CSFML-macOS-clang-arm64
tar -zcvf CSFML-macOS-clang-arm64.tar.gz CSFML-macOS-clang-arm64
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: CSFML-macOS-clang-arm64
path: CSFML-macOS-clang-arm64.tar.gz
+14
View File
@@ -178,6 +178,20 @@ CSFML_GRAPHICS_API sfTexture* sfTexture_copy(const sfTexture* texture);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_destroy(const sfTexture* texture); CSFML_GRAPHICS_API void sfTexture_destroy(const sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Resize the texture
///
/// If this function fails, the texture is left unchanged.
///
/// \param texture Texture to resize
/// \param size Width and height of the texture
/// \param sRgb `true` to enable sRGB conversion, `false` to disable it
///
/// \return `true` if resizing was successful, `false` if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API bool sfTexture_resize(sfTexture* texture, sfVector2u size, bool sRgb);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Return the size of the texture /// \brief Return the size of the texture
/// ///
+9
View File
@@ -170,6 +170,15 @@ void sfTexture_destroy(const sfTexture* texture)
} }
////////////////////////////////////////////////////////////
bool sfTexture_resize(sfTexture* texture, sfVector2u size, bool sRgb)
{
assert(texture);
assert(texture->This);
return texture->This->resize(convertVector2(size), sRgb);
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfVector2u sfTexture_getSize(const sfTexture* texture) sfVector2u sfTexture_getSize(const sfTexture* texture)
{ {
+1 -1
View File
@@ -48,12 +48,12 @@ add_executable(test-csfml-graphics
Graphics/BlendMode.test.cpp Graphics/BlendMode.test.cpp
Graphics/Color.test.cpp Graphics/Color.test.cpp
Graphics/CoordinateType.test.cpp Graphics/CoordinateType.test.cpp
Graphics/Image.test.cpp
Graphics/PrimitiveType.test.cpp Graphics/PrimitiveType.test.cpp
Graphics/Rect.test.cpp Graphics/Rect.test.cpp
Graphics/RenderStates.test.cpp Graphics/RenderStates.test.cpp
Graphics/Shape.test.cpp Graphics/Shape.test.cpp
Graphics/StencilMode.test.cpp Graphics/StencilMode.test.cpp
Graphics/Texture.test.cpp
Graphics/Transform.test.cpp Graphics/Transform.test.cpp
Graphics/VertexArray.test.cpp Graphics/VertexArray.test.cpp
Graphics/View.test.cpp Graphics/View.test.cpp
+56
View File
@@ -0,0 +1,56 @@
#include <CSFML/Graphics/Image.h>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
TEST_CASE("[Graphics] sfImage")
{
SECTION("sfImage_create")
{
const sfImage* image = sfImage_create({100, 100});
REQUIRE(image);
const auto size = sfImage_getSize(image);
CHECK(size.x == 100);
CHECK(size.y == 100);
const auto pixel = sfImage_getPixel(image, {50, 50});
CHECK(pixel.r == sfBlack.r);
CHECK(pixel.g == sfBlack.g);
CHECK(pixel.b == sfBlack.b);
CHECK(pixel.a == sfBlack.a);
CHECK(sfImage_getPixelsPtr(image));
sfImage_destroy(image);
}
SECTION("sfImage_createFromColor")
{
const sfImage* image = sfImage_createFromColor({100, 100}, sfMagenta);
REQUIRE(image);
const auto size = sfImage_getSize(image);
CHECK(size.x == 100);
CHECK(size.y == 100);
const auto pixel = sfImage_getPixel(image, {50, 50});
CHECK(pixel.r == sfMagenta.r);
CHECK(pixel.g == sfMagenta.g);
CHECK(pixel.b == sfMagenta.b);
CHECK(pixel.a == sfMagenta.a);
CHECK(sfImage_getPixelsPtr(image));
sfImage_destroy(image);
}
SECTION("sfImage_createFromFile")
{
const auto filename = std::string("Graphics/sfml-logo-big.") + GENERATE("bmp", "gif", "jpg", "png", "psd");
INFO("Filename: " << filename);
const sfImage* image = sfImage_createFromFile(filename.c_str());
REQUIRE(image);
const auto size = sfImage_getSize(image);
CHECK(size.x == 1001);
CHECK(size.y == 304);
const auto pixel = sfImage_getPixel(image, {0, 0});
CHECK(pixel.r == sfWhite.r);
CHECK(pixel.g == sfWhite.g);
CHECK(pixel.b == sfWhite.b);
CHECK(sfImage_getPixelsPtr(image));
sfImage_destroy(image);
}
}
-65
View File
@@ -1,65 +0,0 @@
#include <CSFML/Graphics/Texture.h>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
TEST_CASE("[Graphics] sfTexture")
{
SECTION("sfTexture_create")
{
const sfTexture* texture = sfTexture_create({100, 100});
REQUIRE(texture);
CHECK(sfTexture_getSize(texture).x == 100);
CHECK(sfTexture_getSize(texture).y == 100);
CHECK(!sfTexture_isSmooth(texture));
CHECK(!sfTexture_isSrgb(texture));
CHECK(!sfTexture_isRepeated(texture));
CHECK(sfTexture_getNativeHandle(texture) != 0);
sfTexture_destroy(texture);
}
SECTION("sfTexture_createSrgb")
{
const sfTexture* texture = sfTexture_createSrgb({100, 100});
REQUIRE(texture);
CHECK(sfTexture_getSize(texture).x == 100);
CHECK(sfTexture_getSize(texture).y == 100);
CHECK(!sfTexture_isSmooth(texture));
CHECK(sfTexture_isSrgb(texture));
CHECK(!sfTexture_isRepeated(texture));
CHECK(sfTexture_getNativeHandle(texture) != 0);
sfTexture_destroy(texture);
}
SECTION("sfTexture_createFromFile")
{
const char* fileExtension = GENERATE("bmp", "gif", "jpg", "png", "psd");
const auto filename = std::string("Graphics/sfml-logo-big.") + fileExtension;
INFO("Filename: " << filename);
const sfTexture* texture = sfTexture_createFromFile(filename.c_str(), nullptr);
REQUIRE(texture);
CHECK(sfTexture_getSize(texture).x > 0);
CHECK(sfTexture_getSize(texture).y > 0);
CHECK(!sfTexture_isSmooth(texture));
CHECK(!sfTexture_isSrgb(texture));
CHECK(!sfTexture_isRepeated(texture));
CHECK(sfTexture_getNativeHandle(texture) != 0);
sfTexture_destroy(texture);
}
SECTION("sfTexture_createSrgbFromFile")
{
const char* fileExtension = GENERATE("bmp", "gif", "jpg", "png", "psd");
const auto filename = std::string("Graphics/sfml-logo-big.") + fileExtension;
INFO("Filename: " << filename);
const sfTexture* texture = sfTexture_createSrgbFromFile(filename.c_str(), nullptr);
REQUIRE(texture);
CHECK(sfTexture_getSize(texture).x > 0);
CHECK(sfTexture_getSize(texture).y > 0);
CHECK(!sfTexture_isSmooth(texture));
CHECK(sfTexture_isSrgb(texture));
CHECK(!sfTexture_isRepeated(texture));
CHECK(sfTexture_getNativeHandle(texture) != 0);
sfTexture_destroy(texture);
}
}
+2 -1
View File
@@ -42,7 +42,7 @@ echo "Please note that all SFML dependencies must be installed and available to
RID="$1" RID="$1"
SFMLBranch="3.0.0" # The branch or tag of the SFML repository to be cloned SFMLBranch="3.0.1" # The branch or tag of the SFML repository to be cloned
CSFMLDir="$(realpath ../../)" # The directory of the source code of CSFML CSFMLDir="$(realpath ../../)" # The directory of the source code of CSFML
OutDir="./CSFML/runtimes/$RID/native" # The base directory of all CSFML modules, used to copy the final libraries OutDir="./CSFML/runtimes/$RID/native" # The base directory of all CSFML modules, used to copy the final libraries
@@ -94,6 +94,7 @@ cmake -E env LDFLAGS="-z origin" \
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$SFMLLibDir" \ "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$SFMLLibDir" \
'-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON' \ '-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON' \
'-DCMAKE_INSTALL_RPATH=$ORIGIN' \ '-DCMAKE_INSTALL_RPATH=$ORIGIN' \
'-DSFML_USE_SYSTEM_DEPS=OFF' \
'-DSFML_BUILD_NETWORK=OFF' \ '-DSFML_BUILD_NETWORK=OFF' \
"$SFMLDir" "$SFMLDir"
+1 -1
View File
@@ -46,7 +46,7 @@ echo "Please note that all SFML dependencies must be installed and available to
RID="$1" RID="$1"
SFMLBranch="3.0.0" # The branch or tag of the SFML repository to be cloned SFMLBranch="3.0.1" # The branch or tag of the SFML repository to be cloned
CSFMLDir="$(grealpath "$(git rev-parse --show-toplevel)")" # The directory of the source code of CSFML CSFMLDir="$(grealpath "$(git rev-parse --show-toplevel)")" # The directory of the source code of CSFML
OutDir="./CSFML/runtimes/$RID/native" # The base directory of all CSFML modules, used to copy the final libraries OutDir="./CSFML/runtimes/$RID/native" # The base directory of all CSFML modules, used to copy the final libraries
+6 -2
View File
@@ -18,6 +18,7 @@ if (-not $RID) {
$Generator = 'Visual Studio 17 2022' $Generator = 'Visual Studio 17 2022'
# See also: https://learn.microsoft.com/en-us/dotnet/core/rid-catalog#known-rids
switch ($RID) { switch ($RID) {
'win-x86' { 'win-x86' {
$Architecture = 'Win32' $Architecture = 'Win32'
@@ -25,6 +26,9 @@ switch ($RID) {
'win-x64' { 'win-x64' {
$Architecture = 'x64' $Architecture = 'x64'
} }
'win-arm64' {
$Architecture = 'ARM64'
}
Default { Default {
Write-Error "Unknown RID '$RID'" Write-Error "Unknown RID '$RID'"
exit exit
@@ -35,7 +39,7 @@ Write-Output "Building $RID"
Write-Output "Using $Generator as the cmake generator" Write-Output "Using $Generator as the cmake generator"
Write-Output "Using architecture $Architecture" Write-Output "Using architecture $Architecture"
$SFMLBranch = "3.0.0" # The branch or tag of the SFML repository to be cloned $SFMLBranch = "3.0.1" # The branch or tag of the SFML repository to be cloned
$CSFMLDir = (Get-Item (git rev-parse --show-toplevel)).FullName # The directory of the source code of CSFML $CSFMLDir = (Get-Item (git rev-parse --show-toplevel)).FullName # The directory of the source code of CSFML
$OutDir = "./CSFML/runtimes/$RID/native" # The directory of all CSFML modules, used to copy the final dlls $OutDir = "./CSFML/runtimes/$RID/native" # The directory of all CSFML modules, used to copy the final dlls
@@ -83,7 +87,7 @@ Push-Location "SFML"
$SFMLDir = (Get-Item .).FullName $SFMLDir = (Get-Item .).FullName
IF ($RID -ne 'win-x86' -and $RID -ne 'win-x64') { IF ($RID -ne 'win-x86' -and $RID -ne 'win-x64' -and $RID -ne 'win-arm64') {
Write-Error "Unknown RID '$RID'" Write-Error "Unknown RID '$RID'"
exit exit
} }