Skip to content
Snippets Groups Projects
Commit 6ba58a2e authored by Gabor Galgoczy's avatar Gabor Galgoczy
Browse files

Revert "Clean code"

This reverts commit 47a7c1a7.
parent 47a7c1a7
Branches
Tags
No related merge requests found
---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -4
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: Right
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: false
PadOperators: true
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Left
AlignOperands: AlignAfterOperator
AlignTrailingComments:
Kind: Always
OverEmptyLines: 1
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros: [ ]
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: MultiLine
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyNamespace: true
BreakAfterAttributes: Leave
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeConceptDeclarations: Always
# BreakBeforeInlineASMColon:
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: ''
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Always
FixNamespaceComments: true
ForEachMacros: [ 'RANGES_FOR', 'FOREACH' ]
IfMacros: [ 'IF' ]
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<glm/'
Priority: 1
- Regex: '^<vulkan/'
Priority: 2
- Regex: '<vk_mem_alloc.h>'
Priority: 3
- Regex: '^<glfw/'
Priority: 4
- Regex: '^<.*\..*'
Priority: 998
- Regex: '^<.*'
Priority: 1
- Regex: '\/.*'
Priority: 999
- Regex: '.*'
Priority: 1000
IncludeIsMainRegex: ''
# IncludeIsMainSourceRegex:
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: Indent
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertBraces: true
InsertNewlineAtEOF: true
IntegerLiteralSeparator:
Binary: 4
Decimal: 3
Hex: 2
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
NamespaceMacros: [ ]
PPIndentWidth: 2
PackConstructorInitializers: CurrentLine
#PenaltyBreakAssignment: 10
#PenaltyBreakBeforeFirstCallParameter: 30
#PenaltyBreakComment: 10
#PenaltyBreakFirstLessLess: 0
#PenaltyBreakOpenParenthesis: 10
#PenaltyBreakString: 10
#PenaltyBreakTemplateDeclaration: 20
#PenaltyExcessCharacter: 1
#PenaltyIndentedWhitespace: 0
#PenaltyReturnTypeOnItsOwnLine: 5
PointerAlignment: Left
QualifierAlignment: Custom
QualifierOrder: [ 'constexpr', 'inline', 'static', 'volatile', 'const', 'type', 'restrict' ]
RawStringFormats:
- Language: Cpp
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Always
ShortNamespaceLines: 0
SortIncludes: CaseInsensitive
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatementsExceptControlMacros
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: false
AfterFunctionDeclarationName: false
AfterFunctionDefinitionName: false
AfterIfMacros: false
AfterOverloadedOperator: false
AfterRequiresInClause: false
AfterRequiresInExpression: true
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 3
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Latest
StatementAttributeLikeMacros: [ ]
StatementMacros: [ ]
TabWidth: 4
TypenameMacros: [ ]
UseTab: Never
WhitespaceSensitiveMacros: [ ]
---
cmake_minimum_required(VERSION 3.25)
include(FetchContent)
set(FETCHCONTENT_QUIET OFF)
project(renderer C CXX)
add_executable(${PROJECT_NAME})
option(engine_debug "Turn on debug mode" ON)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
if (MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE
/W4
/WX
)
else ()
target_compile_options(${PROJECT_NAME} PRIVATE
-Wall
-Wextra
-Werror
-Wno-missing-field-initializers
)
endif ()
target_precompile_headers(${PROJECT_NAME} PRIVATE
<algorithm>
<concepts>
<expected>
<fstream>
<functional>
<iostream>
<limits>
<memory>
<ranges>
<set>
<span>
<sstream>
<stdexcept>
<string>
<string_view>
<thread>
<type_traits>
<unordered_map>
<utility>
<vector>
<variant>
)
# Vulkan
find_package(Vulkan REQUIRED)
target_compile_definitions(${PROJECT_NAME} PRIVATE
VULKAN_HPP_NO_TO_STRING
VULKAN_HPP_NO_CONSTRUCTORS
VULKAN_HPP_NO_SETTERS
VULKAN_HPP_NO_SPACESHIP_OPERATOR
)
if (engine_debug)
target_compile_definitions(${PROJECT_NAME} PRIVATE ENGINE_VULKAN_DEBUG)
endif ()
target_link_libraries(${PROJECT_NAME} PRIVATE Vulkan::Vulkan)
# VulkanMemoryAllocator
set(STATIC_VULKAN_FUNCTIONS 0)
set(DYNAMIC_VULKAN_FUNCTIONS 1)
FetchContent_Declare(VulkanMemoryAllocator
GIT_REPOSITORY https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
GIT_TAG 2f382df
GIT_PROGRESS TRUE
SYSTEM
)
FetchContent_MakeAvailable(VulkanMemoryAllocator)
target_compile_definitions(${PROJECT_NAME} PRIVATE
VMA_STATIC_VULKAN_FUNCTIONS=${STATIC_VULKAN_FUNCTIONS}
VMA_DYNAMIC_VULKAN_FUNCTIONS=${DYNAMIC_VULKAN_FUNCTIONS}
)
target_link_libraries(${PROJECT_NAME} PRIVATE VulkanMemoryAllocator)
# GLFW
FetchContent_Declare(GLFW
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG 3.3.9
GIT_PROGRESS TRUE
SYSTEM
)
FetchContent_MakeAvailable(GLFW)
target_compile_definitions(${PROJECT_NAME} PRIVATE
GLFW_INCLUDE_VULKAN
)
target_link_libraries(${PROJECT_NAME} PRIVATE glfw)
# glm
FetchContent_Declare(glm
GIT_REPOSITORY https://github.com/g-truc/glm.git
GIT_TAG 0.9.9.8
GIT_PROGRESS TRUE
SYSTEM
)
FetchContent_MakeAvailable(glm)
target_compile_definitions(${PROJECT_NAME} PRIVATE
GLM_FORCE_DEPTH_ZERO_TO_ONE
)
target_precompile_headers(${PROJECT_NAME} PRIVATE <glm/glm.hpp>)
target_link_libraries(${PROJECT_NAME} PRIVATE glm::glm)
add_subdirectory(src)
#include "App.hpp"
#include <iostream>
void App::run()
{
std::cout << "Hello World!\n";
}
#pragma once
class App {
public:
void run();
};
target_sources(${PROJECT_NAME} PRIVATE
App.cpp
main.cpp
)
\ No newline at end of file
#include "App.hpp"
int main()
{
App{}.run();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment