Skip to content

turn vsync on for 2 of the examples, add a simplistic FPS counter to them too #2031

turn vsync on for 2 of the examples, add a simplistic FPS counter to them too

turn vsync on for 2 of the examples, add a simplistic FPS counter to them too #2031

Workflow file for this run

name: General CI
on:
push:
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
jobs:
ubuntu-tcc:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
VFLAGS: -cc tcc -no-retry-compilation
SDL3_VERSION: 3.2.0
steps:
- name: Install dependencies
run: |
sudo apt-get install build-essential git make \
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev \
libpipewire-0.3-dev libwayland-dev libdecor-0-dev liburing-dev
curl -L https://www.libsdl.org/release/SDL3-${SDL3_VERSION}.tar.gz -o SDL3.tar.gz
tar -zxvf SDL3.tar.gz
- name: Build SDL
run: |
cd SDL3-${SDL3_VERSION}
cmake -S . -B build
cmake --build build
sudo cmake --install build
- name: Install V
uses: vlang/setup-v@v1
with:
check-latest: true
- name: Checkout SDL
uses: actions/checkout@v4
with:
path: sdl
- name: Link local SDL folder in ~/.vmodules/sdl
run: |
cd sdl
mkdir -p ~/.vmodules
ln -s $(pwd) ~/.vmodules/sdl
- name: Run ~/.vmodules/sdl/setup.vsh
run: |
v ~/.vmodules/sdl/setup.vsh
- name: Test code formatting
run: |
cd sdl
v test-fmt
v fmt -verify .
- name: Build sdl shared
run: |
v -shared -g sdl
- name: Run tests
run: v test sdl
- name: Build sdl examples
run: |
# v shader sdl/examples/sdl_opengl_and_sokol
v run sdl/examples/versions
v should-compile-all sdl/examples/
- name: Test SDL version
run: |
VER="$(v run sdl/examples/version)"
echo "${SDL3_VERSION} == $VER ?"
test "${SDL3_VERSION}" = "$VER" || exit 1
ubuntu-tcc-no-skip-unused:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
VFLAGS: -cc tcc -no-retry-compilation -no-skip-unused
SDL3_VERSION: 3.2.0
steps:
- name: Install dependencies
run: |
sudo apt-get install build-essential git make \
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev \
libpipewire-0.3-dev libwayland-dev libdecor-0-dev liburing-dev
curl -L https://www.libsdl.org/release/SDL3-${SDL3_VERSION}.tar.gz -o SDL3.tar.gz
tar -zxvf SDL3.tar.gz
- name: Build SDL
run: |
cd SDL3-${SDL3_VERSION}
cmake -S . -B build
cmake --build build
sudo cmake --install build
- name: Install V
uses: vlang/setup-v@v1
with:
check-latest: true
- name: Checkout SDL
uses: actions/checkout@v4
with:
path: sdl
- name: Link local SDL folder in ~/.vmodules/sdl
run: |
cd sdl
mkdir -p ~/.vmodules
ln -s $(pwd) ~/.vmodules/sdl
- name: Run ~/.vmodules/sdl/setup.vsh
run: |
v ~/.vmodules/sdl/setup.vsh
- name: Test code formatting
run: |
cd sdl
v test-fmt
v fmt -verify .
- name: Build sdl shared
run: |
v -shared -g sdl
- name: Run tests
run: v test sdl
- name: Build sdl examples
run: |
# v shader sdl/examples/sdl_opengl_and_sokol
v run sdl/examples/versions
v should-compile-all sdl/examples/
- name: Test SDL version
run: |
VER="$(v run sdl/examples/version)"
echo "${SDL3_VERSION} == $VER ?"
test "${SDL3_VERSION}" = "$VER" || exit 1