MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
space::anonymous_namespace{asteroids3d_window.cpp} Namespace Reference

Functions

std::string resolve_asset_root (const std::string &path)
std::string resolve_shader_root (const std::string &asset_root)

Variables

constexpr std::uint32_t MULTIPLAYER_KILLS_TO_WIN = 10U
constexpr std::array< float, NETWORK_PLAYER_COUNTMULTIPLAYER_SPAWN_YAWS = {-135.0f, 45.0f, -45.0f, 135.0f}
constexpr std::array< glm::vec3, NETWORK_PLAYER_COUNTMULTIPLAYER_SPAWNS

Function Documentation

◆ resolve_asset_root()

std::string space::anonymous_namespace{asteroids3d_window.cpp}::resolve_asset_root ( const std::string & path)
nodiscard

Definition at line 57 of file asteroids3d_window.cpp.

57 {
58 if (!path.empty() && path != ".") {
59 return path;
60 }
61
62 if (const char *base_path = SDL_GetBasePath(); base_path != nullptr && base_path[0] != '\0') {
63 return std::filesystem::path(base_path).lexically_normal().string();
64 }
65
66 return ".";
67 }

◆ resolve_shader_root()

std::string space::anonymous_namespace{asteroids3d_window.cpp}::resolve_shader_root ( const std::string & asset_root)
nodiscard

Definition at line 69 of file asteroids3d_window.cpp.

69 {
70 const std::filesystem::path requested_root = std::filesystem::path(asset_root) / "data";
71 if (std::filesystem::exists(requested_root / "crt.frag.spv")) {
72 return requested_root.lexically_normal().string();
73 }
74
75 if (const char *base_path = SDL_GetBasePath(); base_path != nullptr && base_path[0] != '\0') {
76 const std::filesystem::path runtime_root = std::filesystem::path(base_path) / "data";
77 if (std::filesystem::exists(runtime_root / "crt.frag.spv")) {
78 return runtime_root.lexically_normal().string();
79 }
80 }
81
82 return requested_root.lexically_normal().string();
83 }

Variable Documentation

◆ MULTIPLAYER_KILLS_TO_WIN

std::uint32_t space::anonymous_namespace{asteroids3d_window.cpp}::MULTIPLAYER_KILLS_TO_WIN = 10U
constexpr

Definition at line 85 of file asteroids3d_window.cpp.

◆ MULTIPLAYER_SPAWN_YAWS

std::array<float, NETWORK_PLAYER_COUNT> space::anonymous_namespace{asteroids3d_window.cpp}::MULTIPLAYER_SPAWN_YAWS = {-135.0f, 45.0f, -45.0f, 135.0f}
constexpr

Definition at line 89 of file asteroids3d_window.cpp.

89{-135.0f, 45.0f, -45.0f, 135.0f};

◆ MULTIPLAYER_SPAWNS

std::array<glm::vec3, NETWORK_PLAYER_COUNT> space::anonymous_namespace{asteroids3d_window.cpp}::MULTIPLAYER_SPAWNS
constexpr
Initial value:
= {
glm::vec3{-75.0f, 0.0f, -75.0f}, glm::vec3{75.0f, 0.0f, 75.0f},
glm::vec3{-75.0f, 0.0f, 75.0f}, glm::vec3{75.0f, 0.0f, -75.0f}}

Definition at line 86 of file asteroids3d_window.cpp.

86 {
87 glm::vec3{-75.0f, 0.0f, -75.0f}, glm::vec3{75.0f, 0.0f, 75.0f},
88 glm::vec3{-75.0f, 0.0f, 75.0f}, glm::vec3{75.0f, 0.0f, -75.0f}};