Raven Engine v0.1
Loading...
Searching...
No Matches
Raven::VulkanTexture2D Class Reference

Vulkan-specific 2D texture implementation. More...

#include <VulkanTexture.h>

Inheritance diagram for Raven::VulkanTexture2D:
Raven::Texture2D Raven::Texture

Public Member Functions

 VulkanTexture2D (const TextureSpecification &spec)
 Constructs an empty Vulkan texture with the given specification.
 VulkanTexture2D (u32 width, u32 height)
 Constructs an empty Vulkan texture with given width and height.
 VulkanTexture2D (const std::string &path, bool loadUnorm)
 Constructs a Vulkan texture by loading from an image file path.
 ~VulkanTexture2D ()
 Destructor releases Vulkan image resources.
u32 GetWidth () const override
 Retrieves the width of the texture in pixels.
u32 GetHeight () const override
 Retrieves the height of the texture in pixels.
TextureSpecificationGetSpecification () override
 Accesses the texture's specification.
const TextureSpecificationGetSpecification () const override
 Accesses the texture's specification (const version).
const std::string & GetPath () const override
 Retrieves the original file path the texture was loaded from.
Ref< Image2DGetImage () const override
 Retrieves the underlying Image2D resource.
Public Member Functions inherited from Raven::Texture
virtual ~Texture ()=default
 Virtual destructor.

Additional Inherited Members

Static Public Member Functions inherited from Raven::Texture2D
static Ref< Texture2DCreate (u32 width, u32 height)
 Creates a 2D texture with given width and height.
static Ref< Texture2DCreate (const TextureSpecification &specification)
 Creates a 2D texture from a TextureSpecification.
static Ref< Texture2DCreate (const std::string &path, bool loadUnorm=false)
 Loads a 2D texture from a file path.

Detailed Description

Vulkan-specific 2D texture implementation.

Handles Vulkan image creation and staging buffer setup for texture data. Provides access to texture metadata and underlying image object.

Constructor & Destructor Documentation

◆ VulkanTexture2D() [1/3]

Raven::VulkanTexture2D::VulkanTexture2D ( const TextureSpecification & spec)

Constructs an empty Vulkan texture with the given specification.

Parameters
specTexture parameters such as size and format.

◆ VulkanTexture2D() [2/3]

Raven::VulkanTexture2D::VulkanTexture2D ( u32 width,
u32 height )

Constructs an empty Vulkan texture with given width and height.

Parameters
widthTexture width in pixels.
heightTexture height in pixels.

◆ VulkanTexture2D() [3/3]

Raven::VulkanTexture2D::VulkanTexture2D ( const std::string & path,
bool loadUnorm )

Constructs a Vulkan texture by loading from an image file path.

Loads texture data into a staging buffer, transfers to GPU image, and generates mipmaps.

Parameters
pathFilesystem path to the texture image.
loadUnormLoad a Texture in RGBA8_UNORM colorspace instead of RGBA8_SRGB. Useful for Normals.

◆ ~VulkanTexture2D()

Raven::VulkanTexture2D::~VulkanTexture2D ( )

Destructor releases Vulkan image resources.

Member Function Documentation

◆ GetHeight()

u32 Raven::VulkanTexture2D::GetHeight ( ) const
inlineoverridevirtual

Retrieves the height of the texture in pixels.

Returns
Height as unsigned 32-bit integer.

Implements Raven::Texture.

◆ GetImage()

Ref< Image2D > Raven::VulkanTexture2D::GetImage ( ) const
inlineoverridevirtual

Retrieves the underlying Image2D resource.

Returns
A Ref to the Image2D object.

Implements Raven::Texture.

◆ GetPath()

const std::string & Raven::VulkanTexture2D::GetPath ( ) const
inlineoverridevirtual

Retrieves the original file path the texture was loaded from.

Returns
Reference to the path string.

Implements Raven::Texture.

◆ GetSpecification() [1/2]

const TextureSpecification & Raven::VulkanTexture2D::GetSpecification ( ) const
inlineoverridevirtual

Accesses the texture's specification (const version).

Returns
A const reference to the TextureSpecification.

Implements Raven::Texture.

◆ GetSpecification() [2/2]

TextureSpecification & Raven::VulkanTexture2D::GetSpecification ( )
inlineoverridevirtual

Accesses the texture's specification.

Returns
A modifiable reference to the TextureSpecification.

Implements Raven::Texture.

◆ GetWidth()

u32 Raven::VulkanTexture2D::GetWidth ( ) const
inlineoverridevirtual

Retrieves the width of the texture in pixels.

Returns
Width as unsigned 32-bit integer.

Implements Raven::Texture.


The documentation for this class was generated from the following files: