Skip to content

Commit e8a9f5e

Browse files
committed
Initial release
0 parents  commit e8a9f5e

20 files changed

+49953
-0
lines changed

.clang-format

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Language: Cpp
2+
AccessModifierOffset: -4
3+
AlignAfterOpenBracket: DontAlign
4+
AllowShortCaseLabelsOnASingleLine: true
5+
AllowShortIfStatementsOnASingleLine: true
6+
AlwaysBreakTemplateDeclarations: Yes
7+
BraceWrapping:
8+
AfterFunction: true
9+
BreakBeforeBraces: Custom
10+
ColumnLimit: 0
11+
IncludeBlocks: Regroup
12+
IncludeCategories:
13+
- Regex: '^<.*\.h>'
14+
Priority: 2
15+
- Regex: '^<.*'
16+
Priority: 3
17+
- Regex: '.*'
18+
Priority: 1
19+
IndentCaseLabels: true
20+
IndentWidth: 4
21+
KeepEmptyLinesAtTheStartOfBlocks: false
22+
MaxEmptyLinesToKeep: 2
23+
NamespaceIndentation: All
24+
PointerAlignment: Left
25+
SpaceAfterCStyleCast: true
26+
SpacesBeforeTrailingComments: 2

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 4
7+
tab_width = 8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.cpp text
2+
*.h text
3+
*.txt text
4+
*.md text
5+
.* text
6+
*.png filter=lfs diff=lfs merge=lfs -text

.github/workflows/build.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.*'
7+
8+
permissions:
9+
packages: read
10+
contents: write
11+
12+
jobs:
13+
create_release:
14+
name: Create Release
15+
runs-on: ubuntu-latest
16+
17+
outputs:
18+
upload_url: ${{ steps.create_release.outputs.upload_url }}
19+
20+
steps:
21+
- name: Create Release
22+
id: create_release
23+
uses: actions/create-release@v1
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
tag_name: ${{ github.ref }}
28+
release_name: Release ${{ github.ref }}
29+
draft: false
30+
prerelease: false
31+
32+
release_assets:
33+
name: Release Assets
34+
needs: create_release
35+
runs-on: ${{ matrix.os }}
36+
37+
strategy:
38+
matrix:
39+
os: [ubuntu-latest, windows-latest]
40+
build_type: [Release]
41+
cpp_compiler: [g++-13, cl]
42+
include:
43+
- os: windows-latest
44+
cpp_compiler: cl
45+
- os: ubuntu-latest
46+
cpp_compiler: g++-13
47+
exclude:
48+
- os: windows-latest
49+
cpp_compiler: g++-13
50+
- os: ubuntu-latest
51+
cpp_compiler: cl
52+
53+
steps:
54+
- uses: actions/checkout@v3
55+
56+
- name: Set Reusable Strings
57+
id: strings
58+
shell: bash
59+
run: |
60+
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
61+
62+
- name: Install GCC
63+
if: ${{ matrix.os == 'ubuntu-latest' }}
64+
shell: bash
65+
run: |
66+
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
67+
sudo apt-get update
68+
sudo apt-get -y install g++-13
69+
70+
- name: Configure CMake
71+
run: >
72+
cmake -B ${{ steps.strings.outputs.build-output-dir }}
73+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
74+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
75+
-S ${{ github.workspace }}
76+
77+
- name: Build
78+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
79+
80+
- name: Upload Ubuntu Assets
81+
if: ${{ matrix.os == 'ubuntu-latest' }}
82+
uses: actions/upload-release-asset@v1
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
with:
86+
upload_url: ${{ needs.create_release.outputs.upload_url }}
87+
asset_name: vtdoom
88+
asset_path: ${{ steps.strings.outputs.build-output-dir }}/vtdoom
89+
asset_content_type: application/octet-stream
90+
91+
- name: Upload Windows Assets
92+
if: ${{ matrix.os == 'windows-latest' }}
93+
uses: actions/upload-release-asset@v1
94+
env:
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
with:
97+
upload_url: ${{ needs.create_release.outputs.upload_url }}
98+
asset_name: vtdoom.exe
99+
asset_path: ${{ steps.strings.outputs.build-output-dir }}/Release/vtdoom.exe
100+
asset_content_type: application/octet-stream

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vs/

CMakeLists.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cmake_minimum_required(VERSION 3.15)
2+
project(vtdoom)
3+
4+
set(
5+
MAIN_FILES
6+
"src/main.cpp"
7+
"src/PureDOOM.c"
8+
"src/input.cpp"
9+
"src/os.cpp"
10+
"src/renderer.cpp"
11+
)
12+
13+
set(
14+
DOC_FILES
15+
"README.md"
16+
"LICENSE.txt"
17+
)
18+
19+
if(WIN32)
20+
add_compile_options(/EHsc-)
21+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
22+
endif()
23+
24+
add_executable(vtdoom ${MAIN_FILES})
25+
26+
if(UNIX)
27+
target_link_libraries(vtdoom -lpthread)
28+
endif()
29+
30+
set_target_properties(vtdoom PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED On)
31+
source_group("Doc Files" FILES ${DOC_FILES})

CMakeSettings.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "x64-Debug",
5+
"generator": "Ninja",
6+
"configurationType": "Debug",
7+
"inheritEnvironments": [ "msvc_x64_x64" ],
8+
"buildRoot": "${projectDir}\\build\\${name}",
9+
"installRoot": "${projectDir}\\build\\install\\${name}",
10+
"cmakeCommandArgs": "",
11+
"buildCommandArgs": "",
12+
"ctestCommandArgs": ""
13+
},
14+
{
15+
"name": "x64-Release",
16+
"generator": "Ninja",
17+
"configurationType": "RelWithDebInfo",
18+
"inheritEnvironments": [ "msvc_x64_x64" ],
19+
"buildRoot": "${projectDir}\\build\\${name}",
20+
"installRoot": "${projectDir}\\build\\install\\${name}",
21+
"cmakeCommandArgs": "",
22+
"buildCommandArgs": "",
23+
"ctestCommandArgs": ""
24+
}
25+
]
26+
}

0 commit comments

Comments
 (0)