Skip to content

Commit

Permalink
[code] Shorten names
Browse files Browse the repository at this point in the history
  • Loading branch information
IceflowRE committed Apr 22, 2020
1 parent 2717207 commit 6602817
Show file tree
Hide file tree
Showing 53 changed files with 469 additions and 470 deletions.
2 changes: 1 addition & 1 deletion example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

using namespace inexor::vulkan_renderer;

InexorApplication renderer;
Application renderer;

int main(int argc, char *argv[]) {
spdlog::init_thread_pool(8192, 2);
Expand Down
6 changes: 3 additions & 3 deletions include/inexor/vulkan-renderer/availability_checks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace inexor::vulkan_renderer {

class InexorAvailabilityChecksManager {
class AvailabilityChecksManager {
private:
uint32_t number_of_available_instance_extensions = 0;

Expand All @@ -37,9 +37,9 @@ class InexorAvailabilityChecksManager {
VkResult create_instance_extensions_cache();

public:
InexorAvailabilityChecksManager() = default;
AvailabilityChecksManager() = default;

~InexorAvailabilityChecksManager() = default;
~AvailabilityChecksManager() = default;

/// @brief Checks if a certain Vulkan instance layer is available on the system.
/// https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkEnumerateInstanceLayerProperties.html
Expand Down
8 changes: 4 additions & 4 deletions include/inexor/vulkan-renderer/camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

namespace inexor::vulkan_renderer {

/// @class InexorCamera
/// @class Camera
/// TODO: Add mutex!
/// TODO: Because this camera class will be used by scripting as well, runtime errors should be expected.
class InexorCamera {
class Camera {
private:
glm::vec3 position = glm::vec3(0.0f, 0.0f, 0.0f);

Expand Down Expand Up @@ -61,9 +61,9 @@ class InexorCamera {
void update_projection_matrix();

public:
InexorCamera() = default;
Camera() = default;

~InexorCamera() = default;
~Camera() = default;

/// @brief Updates all matrices.
void update_matrices();
Expand Down
8 changes: 4 additions & 4 deletions include/inexor/vulkan-renderer/descriptor_bundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ namespace inexor::vulkan_renderer {
///
///
///
struct InexorDescriptorBundle {
struct DescriptorBundle {
public:
/// Force use of the overloaded constructor!
InexorDescriptorBundle() = delete;
DescriptorBundle() = delete;

/// @brief Allow name and descriptor pool to be set in constructor only!
InexorDescriptorBundle(const std::string &internal_descriptor_set_name, std::shared_ptr<InexorDescriptorPool> descriptor_pool)
DescriptorBundle(const std::string &internal_descriptor_set_name, std::shared_ptr<DescriptorPool> descriptor_pool)
: name(internal_descriptor_set_name), associated_descriptor_pool(descriptor_pool) {}

const std::string name;

const std::shared_ptr<InexorDescriptorPool> associated_descriptor_pool;
const std::shared_ptr<DescriptorPool> associated_descriptor_pool;

VkDescriptorSetLayout descriptor_set_layout;

Expand Down
24 changes: 12 additions & 12 deletions include/inexor/vulkan-renderer/descriptor_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

namespace inexor::vulkan_renderer {

/// @class InexorDescriptorManager.
/// @class DescriptorManager.
/// @brief A manager class for descriptor pools, descriptor set layouts and descriptor sets.
class InexorDescriptorManager : public ManagerClassTemplate<InexorDescriptorPool>, public ManagerClassTemplate<InexorDescriptorBundle> {
class DescriptorManager : public ManagerClassTemplate<DescriptorPool>, public ManagerClassTemplate<DescriptorBundle> {
private:
VkDevice device;

Expand All @@ -37,9 +37,9 @@ class InexorDescriptorManager : public ManagerClassTemplate<InexorDescriptorPool
VkResult destroy_descriptor_sets();

public:
InexorDescriptorManager() = default;
DescriptorManager() = default;

~InexorDescriptorManager() = default;
~DescriptorManager() = default;

/// @brief Initialises descriptor manager.
/// @param device [in] The Vulkan device which is being used.
Expand All @@ -53,38 +53,38 @@ class InexorDescriptorManager : public ManagerClassTemplate<InexorDescriptorPool
/// @param pool_sizes [in] The size of the descriptor pool data.
/// @param descriptor_pool [in] A reference of a shared pointer to the descriptor pool which will be created.
VkResult create_descriptor_pool(const std::string &internal_descriptor_pool_name, const std::vector<VkDescriptorPoolSize> &pool_sizes,
std::shared_ptr<InexorDescriptorPool> &descriptor_pool);
std::shared_ptr<DescriptorPool> &descriptor_pool);

/// @brief Starts building a new descriptor.
/// @param
/// @param
/// @param
VkResult create_descriptor_bundle(const std::string &internal_descriptor_name, std::shared_ptr<InexorDescriptorPool> &descriptor_pool,
std::shared_ptr<InexorDescriptorBundle> &descriptor_bundle);
VkResult create_descriptor_bundle(const std::string &internal_descriptor_name, std::shared_ptr<DescriptorPool> &descriptor_pool,
std::shared_ptr<DescriptorBundle> &descriptor_bundle);

///
///
///
VkResult add_descriptor_set_layout_binding(std::shared_ptr<InexorDescriptorBundle> descriptor_bundle,
VkResult add_descriptor_set_layout_binding(std::shared_ptr<DescriptorBundle> descriptor_bundle,
const VkDescriptorSetLayoutBinding &descriptor_set_layout_binding);

///
///
///
VkResult add_write_descriptor_set(std::shared_ptr<InexorDescriptorBundle> descriptor_bundle, const VkWriteDescriptorSet &write_descriptor_set);
VkResult add_write_descriptor_set(std::shared_ptr<DescriptorBundle> descriptor_bundle, const VkWriteDescriptorSet &write_descriptor_set);

///
///
VkResult create_descriptor_set_layouts(std::shared_ptr<InexorDescriptorBundle> descriptor_bundle);
VkResult create_descriptor_set_layouts(std::shared_ptr<DescriptorBundle> descriptor_bundle);

///
///
VkResult create_descriptor_sets(std::shared_ptr<InexorDescriptorBundle> descriptor_bundle);
VkResult create_descriptor_sets(std::shared_ptr<DescriptorBundle> descriptor_bundle);

///
///
///
std::optional<std::shared_ptr<InexorDescriptorBundle>> get_descriptor_bundle(const std::string &internal_descriptor_name);
std::optional<std::shared_ptr<DescriptorBundle>> get_descriptor_bundle(const std::string &internal_descriptor_name);

/// @brief Destroys all descriptor sets and descriptor pools.
/// @param clear_descriptor_layout_bindings [in] True if descriptor set layout bindings should be cleared as well.
Expand Down
6 changes: 3 additions & 3 deletions include/inexor/vulkan-renderer/descriptor_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace inexor::vulkan_renderer {
///
///
///
struct InexorDescriptorPool {
struct DescriptorPool {

/// Force use of the overloaded constructor!
InexorDescriptorPool() = delete;
DescriptorPool() = delete;

///
InexorDescriptorPool(const std::string &internal_descriptor_pool_name, const std::vector<VkDescriptorPoolSize> &pool_sizes)
DescriptorPool(const std::string &internal_descriptor_pool_name, const std::vector<VkDescriptorPoolSize> &pool_sizes)
: name(internal_descriptor_pool_name), sizes(pool_sizes) {}

const std::string name;
Expand Down
6 changes: 3 additions & 3 deletions include/inexor/vulkan-renderer/fps_counter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace inexor::vulkan_renderer {

class InexorFPSCounter {
class FPSCounter {
private:
std::size_t frames = 0;

Expand All @@ -14,9 +14,9 @@ class InexorFPSCounter {
float fps_update_interval = 1.0f;

public:
InexorFPSCounter() = default;
FPSCounter() = default;

~InexorFPSCounter() = default;
~FPSCounter() = default;

std::optional<uint32_t> update();
};
Expand Down
6 changes: 3 additions & 3 deletions include/inexor/vulkan-renderer/gltf-model/animation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
namespace inexor::vulkan_renderer::gltf_model {

///
struct InexorModelAnimation {
struct Animation {
std::string name;

std::vector<InexorModelAnimationSampler> samplers;
std::vector<AnimationSampler> samplers;

std::vector<InexorModelAnimationChannel> channels;
std::vector<AnimationChannel> channels;

float start = std::numeric_limits<float>::max();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
namespace inexor::vulkan_renderer::gltf_model {

///
struct InexorModelAnimationChannel {
struct AnimationChannel {
enum PathType { TRANSLATION, ROTATION, SCALE };

PathType path;

std::shared_ptr<InexorModelNode> node;
std::shared_ptr<ModelNode> node;

uint32_t samplerIndex;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace inexor::vulkan_renderer::gltf_model {

///
struct InexorModelAnimationSampler {
struct AnimationSampler {
enum InterpolationType { LINEAR, STEP, CUBICSPLINE };

InterpolationType interpolation;
Expand Down
2 changes: 1 addition & 1 deletion include/inexor/vulkan-renderer/gltf-model/dimensions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace inexor::vulkan_renderer::gltf_model {

/// TODO: Remove this!
struct InexorDimensions {
struct Dimensions {
glm::vec3 min = glm::vec3(FLT_MAX);
glm::vec3 max = glm::vec3(-FLT_MAX);
};
Expand Down
50 changes: 25 additions & 25 deletions include/inexor/vulkan-renderer/gltf-model/manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@

namespace inexor::vulkan_renderer::gltf_model {

/// @class InexorModelManager
/// TODO: Make InexorModelLoader and inherit!
/// @class Manager
/// TODO: Make ModelLoader and inherit!
/// @brief A manager class for model in glTF 2.0 format.
/// https://www.khronos.org/gltf/
struct InexorModelManager : ManagerClassTemplate<InexorModel> {
struct Manager : ManagerClassTemplate<Model> {

public:
InexorModelManager() = default;
Manager() = default;

~InexorModelManager() = default;
~Manager() = default;

private:
VkDevice device;
Expand All @@ -49,14 +49,14 @@ struct InexorModelManager : ManagerClassTemplate<InexorModel> {

std::shared_ptr<VulkanTextureManager> texture_manager;

std::shared_ptr<VulkanUniformBufferManager> uniform_buffer_manager;
std::shared_ptr<UniformBufferManager> uniform_buffer_manager;

std::shared_ptr<InexorMeshBufferManager> mesh_buffer_manager;
std::shared_ptr<MeshBufferManager> mesh_buffer_manager;

std::shared_ptr<InexorDescriptorManager> descriptor_manager;
std::shared_ptr<DescriptorManager> descriptor_manager;

// The global descriptor bundle for glTF 2.0 models.
std::shared_ptr<InexorDescriptorBundle> gltf_global_descriptor_bundle;
std::shared_ptr<DescriptorBundle> gltf_global_descriptor_bundle;

public:
/// @brief Initialises Vulkan glTF 2.0 model manager.
Expand All @@ -66,8 +66,8 @@ struct InexorModelManager : ManagerClassTemplate<InexorModel> {
/// @param uniform_buffer_manager [in] A shared pointer to the uniform buffer manager.
/// @param mesh_buffer_manager [in] mesh_buffer_manager A shared pointer to the mesh buffer manager.
VkResult init(const VkDevice &device, const std::shared_ptr<VulkanTextureManager> texture_manager,
const std::shared_ptr<VulkanUniformBufferManager> uniform_buffer_manager, const std::shared_ptr<InexorMeshBufferManager> mesh_buffer_manager,
const std::shared_ptr<InexorDescriptorManager> descriptor_manager);
const std::shared_ptr<UniformBufferManager> uniform_buffer_manager, const std::shared_ptr<MeshBufferManager> mesh_buffer_manager,
const std::shared_ptr<DescriptorManager> descriptor_manager);

/// @brief Loads a glTF 2.0 file.
/// @param internal_model_name [in] The internal name of the glTF 2.0 model which is used inside of the engine.
Expand Down Expand Up @@ -98,25 +98,25 @@ struct InexorModelManager : ManagerClassTemplate<InexorModel> {
private:
/// @brief Sets up descriptor sets for glTF model nodes.
/// @param node [in] A glTF model node.
VkResult setup_node_descriptor_set(std::shared_ptr<InexorModelNode> node);
VkResult setup_node_descriptor_set(std::shared_ptr<ModelNode> node);

///
///
///
VkResult load_model_from_file(const std::string &file_name, std::shared_ptr<InexorModel> &new_model, const float scale = 1.0f);
VkResult load_model_from_file(const std::string &file_name, std::shared_ptr<Model> &new_model, const float scale = 1.0f);

///
void destroy();

///
void load_node(std::shared_ptr<InexorModelNode> parent, const tinygltf::Node &node, const uint32_t nodeIndex, std::shared_ptr<InexorModel> model,
void load_node(std::shared_ptr<ModelNode> parent, const tinygltf::Node &node, const uint32_t nodeIndex, std::shared_ptr<Model> model,
const float globalscale);

///
void load_skins(std::shared_ptr<InexorModel> model);
void load_skins(std::shared_ptr<Model> model);

///
void load_textures(std::shared_ptr<InexorModel> model);
void load_textures(std::shared_ptr<Model> model);

///
VkSamplerAddressMode get_wrap_mode(const int32_t wrapMode);
Expand All @@ -125,31 +125,31 @@ struct InexorModelManager : ManagerClassTemplate<InexorModel> {
VkFilter get_filter_mode(const int32_t filterMode);

///
void load_texture_samplers(std::shared_ptr<InexorModel> model);
void load_texture_samplers(std::shared_ptr<Model> model);

///
void load_materials(std::shared_ptr<InexorModel> model);
void load_materials(std::shared_ptr<Model> model);

///
void load_animations(std::shared_ptr<InexorModel> model);
void load_animations(std::shared_ptr<Model> model);

///
void render_node(std::shared_ptr<InexorModelNode> node, VkCommandBuffer commandBuffer, VkPipelineLayout pipeline_layout, std::size_t current_image_index);
void render_node(std::shared_ptr<ModelNode> node, VkCommandBuffer commandBuffer, VkPipelineLayout pipeline_layout, std::size_t current_image_index);

///
void calculate_bounding_box(std::shared_ptr<InexorModel> model, std::shared_ptr<InexorModelNode> node, std::shared_ptr<InexorModelNode> parent);
void calculate_bounding_box(std::shared_ptr<Model> model, std::shared_ptr<ModelNode> node, std::shared_ptr<ModelNode> parent);

///
void get_scene_dimensions(std::shared_ptr<InexorModel> model);
void get_scene_dimensions(std::shared_ptr<Model> model);

///
void update_animation(std::shared_ptr<InexorModel> model, const uint32_t index, const float time);
void update_animation(std::shared_ptr<Model> model, const uint32_t index, const float time);

///
std::shared_ptr<InexorModelNode> find_node(std::shared_ptr<InexorModelNode> parent, const uint32_t index);
std::shared_ptr<ModelNode> find_node(std::shared_ptr<ModelNode> parent, const uint32_t index);

///
std::shared_ptr<InexorModelNode> node_from_index(std::shared_ptr<InexorModel> model, const uint32_t index);
std::shared_ptr<ModelNode> node_from_index(std::shared_ptr<Model> model, const uint32_t index);
};

} // namespace inexor::vulkan_renderer::gltf_model
Loading

0 comments on commit 6602817

Please sign in to comment.