linux build pass

This commit is contained in:
2025-05-27 00:21:53 +09:00
parent 9a20f0b3db
commit ab27eb80db
8 changed files with 220 additions and 3 deletions

11
.vscode/c_cpp_properties.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"configurations": [
{
"compileCommands": "build/compile_commands.json",
"intelliSenseMode": "linux-gcc-x64",
"cStandard": "c17",
"cppStandard": "c++20"
}
],
"version": 4
}

55
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,55 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb)Client Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Client/Client",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build/Client/",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "(gdb)Server Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Server/Server",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build/Server/",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}

98
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,98 @@
{
"files.associations": {
"cctype": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"compare": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"format": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"semaphore": "cpp",
"span": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp",
"variant": "cpp",
"__bit_reference": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__node_handle": "cpp",
"__split_buffer": "cpp",
"__threading_support": "cpp",
"__verbose_abort": "cpp",
"ios": "cpp",
"locale": "cpp",
"print": "cpp",
"queue": "cpp",
"stack": "cpp",
"fstream": "cpp",
"regex": "cpp",
"assert": "cpp",
"pointers": "cpp",
"future": "cpp",
"zstring": "cpp",
"set": "cpp",
"util": "cpp",
"expected": "cpp",
"complex": "cpp",
"__config": "cpp",
"ranges": "cpp",
"valarray": "cpp",
"__tree": "cpp",
"map": "cpp",
"iostream": "cpp",
"any": "cpp",
"clocale": "cpp",
"codecvt": "cpp",
"list": "cpp",
"unordered_set": "cpp",
"numeric": "cpp",
"source_location": "cpp",
"numbers": "cpp"
}
}

36
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,36 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "ninja-build",
"command": "ninja",
"args": [],
"options": {
"cwd": "${workspaceFolder}/build/"
},
"group": {
"kind": "build",
"isDefault": true
},
"dependsOn": ["cmake"]
},
{
"type": "shell",
"label": "cmake",
"command": "cmake",
"args": [
"..",
"-G",
"Ninja"
],
"options": {
"cwd": "${workspaceFolder}/build/"
},
"group": {
"kind": "build",
"isDefault": false
}
},
]
}

View File

@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.5)
set(PROJECT_NAME "Asteroid")
set(CMAKE_BUILD_TYPE Debug)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
endif()

View File

@@ -23,7 +23,7 @@ void Loader::loadModel(inModel model) {
uv);
}
for (Vertex& const it : model.vertices) {
for (const Vertex& it : model.vertices) {
model.original_offset.x += it.position.x / model.vertices.size();
model.original_offset.y += it.position.y / model.vertices.size();
model.original_offset.z += it.position.z / model.vertices.size();

View File

@@ -1,2 +1,9 @@
#ifndef NDEBUG
#undef __OPTIMIZE__
#endif
#define STB_IMAGE_IMPLEMENTATION
#include "stb/stb_image.h"
#ifndef NDEBUG
#define __OPTIMIZE__ 1
#endif

View File

@@ -140,8 +140,15 @@ void Graphics::CreateLogicalDeviceAndQueues() {
}
VkPhysicalDeviceFeatures required_features = {};
required_features.depthBounds = true;
required_features.depthClamp = true;
VkPhysicalDeviceFeatures supported_features;
vkGetPhysicalDeviceFeatures(physical_device_, &supported_features);
if (supported_features.depthBounds) {
required_features.depthBounds = VK_TRUE;
}
if (supported_features.depthClamp) {
required_features.depthClamp = VK_TRUE;
}
VkDeviceCreateInfo device_info = {};
device_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;