|
SDLPainter 1.4.0
SDL3 + OpenGL/Vulkan 2D çizim kütüphanesi
|
Türkçe sürüm | English
On my Yazılımperver'in Dünyası site I share practical examples of using various technologies as much as I can, and this page was written in the same spirit. You do not need to follow these steps to use SDLPainter, but I think they will be useful for building and publishing your own images.
graph TD
BASE["debian:13-slim"]
BASE --> BUILDER
subgraph BUILDER["builder"]
B1["gcc-13 / clang-18"]
B2["SDL3 system dependencies"]
B3["Conan 2 + profile"]
B4["Conan cache\nLinux Debug + Release\n(+ Vulkan variants)"]
end
BUILDER --> CI
BUILDER --> WIN
subgraph CI["ci"]
C1["lcov / gcovr"]
C2["mesa-vulkan-drivers\nlavapipe ICD + llvmpipe"]
C3["SDL_VIDEODRIVER=offscreen\nSDL_AUDIODRIVER=dummy"]
C4["VK_ICD_FILENAMES\n→ pin lavapipe"]
C5["vulkan-validationlayers\nVK_LAYER_KHRONOS_validation"]
end
subgraph WIN["windows-cross"]
W1["mingw-w64 / wine64"]
W2["windres wrapper"]
W3["Conan profile: windows-mingw"]
W4["Conan cache\nWindows Debug + Release"]
end
flowchart LR
A([Developer]) --> B["docker build\n--target builder\n-t sdl-painter:dev ."]
B --> C["docker run --rm -it\n-v \$(pwd):/workspace\nsdl-painter:dev bash"]
C --> D["conan install .\n(warm cache — seconds)"]
D --> E["cmake --preset linux-debug"]
E --> F["cmake --build\n--preset linux-debug"]
F --> G["ctest --preset linux-debug\n--output-on-failure"]
flowchart LR
A([CI / Developer]) --> B["docker build\n--target ci\n-t sdl-painter:ci ."]
B --> C["docker run --rm\n-v \$(pwd):/workspace\nsdl-painter:ci bash -c ..."]
C --> D["conan install .\n(warm cache)"]
D --> E["cmake --preset linux-debug"]
E --> F["cmake --build\n--preset linux-debug"]
F --> G{"Test type"}
G -->|Unit test| H["ctest --preset linux-debug\n--output-on-failure"]
G -->|Coverage| I["ctest ... &&\ngcovr -r . build/"]
flowchart LR
A([Developer]) --> B["docker build\n--target windows-cross\n-t sdl-painter:windows-cross ."]
B --> C["docker run --rm\n-v \$(pwd):/workspace\nsdl-painter:windows-cross bash -c ..."]
C --> D["conan install .\n--profile:host=windows-mingw"]
D --> E["cmake --preset\nwindows-mingw-debug"]
E --> F["cmake --build\n--preset windows-mingw-debug"]
F --> G[("Windows .exe / .dll")]
G --> H{"Running"}
H -->|Inside the container| I["wine64 build/MyApp.exe"]
H -->|Copy to a Windows host| J["scp / mount"]
The pipeline uses the images built from this repo's Dockerfile and pushed to the GitLab Container Registry directly. There is no separate .conan_base template or tool installation in before_script — the tools come ready in the image.
| Job | Image | Source |
|---|---|---|
| build:linux:*, test:unit*, quality:* | $CI_REGISTRY_IMAGE | Dockerfile ci / builder target |
| build:windows:* | $CI_REGISTRY_IMAGE/sdl-painter-win-cross | Dockerfile windows-cross target (Linux + MinGW) |
| pages | ubuntu:24.04 | Needs no Conan/CMake, only Doxygen |
| release:publish | release-cli | Runs on a v*.*.* tag |
flowchart TD
PUSH([git push]) --> PIPE[GitLab CI Pipeline]
PIPE --> BUILD[build]
PIPE --> TEST[test]
PIPE --> QUALITY[quality]
PIPE --> DOCS[docs]
PIPE --> REL[release]
BUILD --> BLD["build:linux:debug / release\n— $CI_REGISTRY_IMAGE\n-o with_vulkan=True"]
BUILD --> BWIN["build:windows:debug / release\n— $CI_REGISTRY_IMAGE/sdl-painter-win-cross\nMinGW cross (no Vulkan)"]
TEST --> TU["test:unit\n— $CI_REGISTRY_IMAGE\noffscreen + lavapipe ICD"]
TEST --> TA["test:unit:asan\n— $CI_REGISTRY_IMAGE\nruns independently"]
TEST --> TWN["test:unit:windows\n— commented out (disabled)"]
QUALITY --> FMT["quality:clang-format\n— --Werror, allow_failure"]
QUALITY --> TIDY["quality:clang-tidy\n— allow_failure"]
DOCS --> DOC["pages\n— ubuntu:24.04, Doxygen\n(main only)"]
REL --> RELP["release:publish\n— with a v*.*.* tag"]
style BLD fill:#2d6a4f,color:#fff,stroke:#1b4332
style TU fill:#2d6a4f,color:#fff,stroke:#1b4332
Note: The build:windows:* jobs are not a SaaS Windows runner / MSVC — they use the MinGW cross-compile image (sdl-painter-win-cross) on a Linux runner, and Vulkan is not supported on this target (conanfile.py configure() turns it off automatically). For a native MSVC build the separate Dockerfile.windows image is used (see below).
The same pipeline was also moved to GitHub Actions (.github/workflows/ci.yml). The Linux jobs again use the image built from this repo's Dockerfile; the difference is that the image is pulled from Docker Hub instead of the GitLab Container Registry (yazilimperver/sdl-painter:ci-v1.2).
| Job | Environment | Source |
|---|---|---|
| build-linux-*, test-unit*, quality-* | container: yazilimperver/sdl-painter:ci-v1.2 | Dockerfile ci target → Docker Hub |
| build-windows-* | windows-latest runner (no container) | Native MSVC + actions/cache |
| docs | ubuntu-latest, Doxygen via apt | Output is an artifact only (no Pages publish) |
| release | ubuntu-latest, softprops/action-gh-release | On a v*.*.* tag, notes from CHANGELOG.md |
flowchart LR
B["build-linux-debug/release\nbuild-windows-debug/release"] --> T["test-unit\ntest-unit-asan"]
T --> Q["quality-clang-format\nquality-clang-tidy"]
Q --> D["docs\n(default branch only)"]
Q --> R["release\n(v*.*.* tag only)"]
Where it diverges from GitLab:
The Windows counterpart of the Linux Dockerfile; a standalone, single-OS image: VS Build Tools 17 (VS 2022) + standalone CMake + Python + Conan 2, and a Conan cache pre-warmed with MSVC (Vulkan included). The Linux Conan steps do not run in this image; they stay in the Linux Dockerfile.
WARNING: Do not push this MSVC image to the sdl-painter-win-cross tag used in CI — that tag is the Linux + MinGW image; if it is replaced with MSVC, the build:windows:* jobs (Linux runner) break. Its place: local native MSVC build/test or an optional self-hosted Windows Docker runner (with a separate tag). For details see the "CI status" note inside Dockerfile.windows.
Ready-made builds of all images are published on Docker Hub — they can be pulled directly instead of building the image locally (which takes long, especially because of the Conan pre-warming):
| Tag | Dockerfile target | Size (compressed) | Description |
|---|---|---|---|
| ci-v1.2 | Dockerfile → ci | ~2.2 GB | Versioned tag used by the GitHub Actions Linux jobs |
| ci | Dockerfile → ci | ~2.2 GB | Unversioned tracking tag — points to the latest ci image |
| windows-cross-v1.0 | Dockerfile → windows-cross | ~3.5 GB | Linux + MinGW-w64 cross-compile (Linux container) |
| windows-v1.0 | Dockerfile.windows → windows-msvc | ~7.9 GB | Native MSVC + Vulkan (Windows container — requires Windows containers mode) |
Versioning: When conanfile.py or a Dockerfile changes, a new versioned tag (ci-v1.2 etc.) is pushed and the image reference in the GitHub workflow is updated. Versioned tags are treated as immutable; the ci tracking tag, on the other hand, is moved to the latest image on every release. The GitLab side uses the same images from its own Container Registry ($CI_REGISTRY_IMAGE).
| File / Target | Image tag | Use |
|---|---|---|
| Dockerfile → builder | sdl-painter:dev | Local Linux development |
| Dockerfile → ci | sdl-painter:ci | Headless tests, code coverage, Vulkan (lavapipe) |
| Dockerfile → ci | $CI_REGISTRY_IMAGE | GitLab CI Linux jobs |
| Dockerfile → ci | yazilimperver/sdl-painter:ci-v1.2 (Docker Hub) | GitHub Actions Linux jobs |
| Dockerfile → windows-cross | sdl-painter:windows-cross / $CI_REGISTRY_IMAGE/sdl-painter-win-cross / yazilimperver/sdl-painter:windows-cross-v1.0 (Docker Hub) | Windows cross-compile (MinGW, no Vulkan) |
| Dockerfile.windows → windows-msvc | sdl-painter-windows:latest / yazilimperver/sdl-painter:windows-v1.0 (Docker Hub) | Local native MSVC build + test (with Vulkan) |