Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 55 additions & 33 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,39 +1,61 @@
---
Language: Cpp
BasedOnStyle: LLVM
IndentWidth: 4
TabWidth: 4
# Start from Google C++ Style
BasedOnStyle: Google

# General formatting
IndentWidth: 2
TabWidth: 2
UseTab: Never
ColumnLimit: 120 # No forced wrapping; useful for long VulkanHpp calls
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
ColumnLimit: 80

# Braces and indentation
BreakBeforeBraces: Attach
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
Cpp11BracedListStyle: true

# Spaces
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true

# Pointer and reference alignment
DerivePointerAlignment: false
NamespaceIndentation: None
PointerAlignment: Left
ReferenceAlignment: Left

# Includes
IncludeBlocks: Regroup
SortIncludes: true
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*>'
Priority: 2
- Regex: '.*'
Priority: 3

# Namespace formatting
NamespaceIndentation: None
IndentNamespace: None

# Comments
CommentPragmas: '^ IWYU pragma:'

# C++ specifics
Standard: Cpp17
AccessModifierOffset: -1
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2

# Alignments
AlignAfterOpenBracket: Align
AlignOperands: true
AlignTrailingComments: true

# Others
BinPackArguments: true
BinPackParameters: true
Cpp11BracedListStyle: true
ReflowComments: true
32 changes: 0 additions & 32 deletions .clang-tidy

This file was deleted.

96 changes: 48 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
name: CMake Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true

- name: Cache vcpkg dependencies
uses: actions/cache@v4
with:
# The path to cache is the entire vcpkg directory
path: ${{ github.workspace }}/vcpkg
# The key is specific to the OS and the contents of your vcpkg manifest
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
# A fallback key to restore the latest cache for the current OS
restore-keys: |
vcpkg-${{ runner.os }}-

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libvulkan-dev \
libxinerama-dev \
libxcursor-dev \
xorg-dev \
libglu1-mesa-dev \
pkg-config \
clang-tidy

- name: Bootstrap vcpkg
run: ./vcpkg/bootstrap-vcpkg.sh

- name: Configure CMake with compile commands
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake

- name: Build
run: cmake --build build --config Release
name: CMake Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Cache vcpkg dependencies
uses: actions/cache@v4
with:
# The path to cache is the entire vcpkg directory
path: ${{ github.workspace }}/vcpkg
# The key is specific to the OS and the contents of your vcpkg manifest
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
# A fallback key to restore the latest cache for the current OS
restore-keys: |
vcpkg-${{ runner.os }}-
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libvulkan-dev \
libxinerama-dev \
libxcursor-dev \
xorg-dev \
libglu1-mesa-dev \
pkg-config \
clang-tidy
- name: Bootstrap vcpkg
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Configure CMake with compile commands
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: cmake --build build --config Release
16 changes: 9 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
build/
cmake-build-debug/
vcpkg_installed/
.idea
resources/
*.fbx
workspace/
build/
cmake-build-debug/
vcpkg_installed/
.idea
resources/
*.fbx
workspace/
*~
vcpkg/
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/microsoft/vcpkg.git
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/microsoft/vcpkg.git
Loading