Skip to content

Commit

Permalink
Change vkb::scene_graph::component::HPPImage from a facade over vkb::…
Browse files Browse the repository at this point in the history
…sg::Image to a self-contained class using Vulkan-Hpp. (#809)
  • Loading branch information
asuessenbach authored Oct 9, 2023
1 parent a56ced6 commit df6ee26
Show file tree
Hide file tree
Showing 12 changed files with 457 additions and 53 deletions.
3 changes: 2 additions & 1 deletion framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ set(SCENE_GRAPH_COMPONENT_FILES
scene_graph/components/transform.cpp
scene_graph/components/image/astc.cpp
scene_graph/components/image/ktx.cpp
scene_graph/components/image/stb.cpp)
scene_graph/components/image/stb.cpp
scene_graph/components/hpp_image.cpp)

set(SCENE_GRAPH_SCRIPTS_FILES
# Header Files
Expand Down
6 changes: 3 additions & 3 deletions framework/hpp_api_vulkan_sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ vk::ImageLayout HPPApiVulkanSample::descriptor_type_to_image_layout(vk::Descript
}
}

HPPTexture HPPApiVulkanSample::load_texture(const std::string &file, vkb::sg::Image::ContentType content_type, vk::SamplerAddressMode address_mode)
HPPTexture HPPApiVulkanSample::load_texture(const std::string &file, vkb::scene_graph::components::HPPImage::ContentType content_type, vk::SamplerAddressMode address_mode)
{
HPPTexture texture;

Expand Down Expand Up @@ -887,7 +887,7 @@ HPPTexture HPPApiVulkanSample::load_texture(const std::string &file, vkb::sg::Im
return texture;
}

HPPTexture HPPApiVulkanSample::load_texture_array(const std::string &file, vkb::sg::Image::ContentType content_type, vk::SamplerAddressMode address_mode)
HPPTexture HPPApiVulkanSample::load_texture_array(const std::string &file, vkb::scene_graph::components::HPPImage::ContentType content_type, vk::SamplerAddressMode address_mode)
{
HPPTexture texture{};

Expand Down Expand Up @@ -953,7 +953,7 @@ HPPTexture HPPApiVulkanSample::load_texture_array(const std::string &file, vkb::
return texture;
}

HPPTexture HPPApiVulkanSample::load_texture_cubemap(const std::string &file, vkb::sg::Image::ContentType content_type)
HPPTexture HPPApiVulkanSample::load_texture_cubemap(const std::string &file, vkb::scene_graph::components::HPPImage::ContentType content_type)
{
HPPTexture texture{};

Expand Down
10 changes: 5 additions & 5 deletions framework/hpp_api_vulkan_sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,24 +176,24 @@ class HPPApiVulkanSample : public vkb::HPPVulkanSample
* @param address_mode The address mode to use in u-, v-, and w-direction. Defaults to /c vk::SamplerAddressMode::eRepeat.
*/
HPPTexture
load_texture(const std::string &file, vkb::sg::Image::ContentType content_type, vk::SamplerAddressMode address_mode = vk::SamplerAddressMode::eRepeat);
load_texture(const std::string &file, vkb::scene_graph::components::HPPImage::ContentType content_type, vk::SamplerAddressMode address_mode = vk::SamplerAddressMode::eRepeat);

/**
* @brief Loads in a ktx 2D texture array
* @param file The filename of the texture to load
* @param content_type The type of content in the image file
* @param address_mode The address mode to use in u-, v-, and w-direction. Defaults to /c vk::SamplerAddressMode::eClampToEdge.
*/
HPPTexture load_texture_array(const std::string &file,
vkb::sg::Image::ContentType content_type,
vk::SamplerAddressMode address_mode = vk::SamplerAddressMode::eClampToEdge);
HPPTexture load_texture_array(const std::string &file,
vkb::scene_graph::components::HPPImage::ContentType content_type,
vk::SamplerAddressMode address_mode = vk::SamplerAddressMode::eClampToEdge);

/**
* @brief Loads in a ktx 2D texture cubemap
* @param file The filename of the texture to load
* @param content_type The type of content in the image file
*/
HPPTexture load_texture_cubemap(const std::string &file, vkb::sg::Image::ContentType content_type);
HPPTexture load_texture_cubemap(const std::string &file, vkb::scene_graph::components::HPPImage::ContentType content_type);

/**
* @brief Loads in a single model from a GLTF file
Expand Down
Loading

0 comments on commit df6ee26

Please sign in to comment.