Raven Engine v0.1
A modern 3D Game Engine
Loading...
Searching...
No Matches
Raven::VulkanTexture2D Class Reference

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

#include <VulkanTexture.h>

Inherits Raven::Texture2D.

Public Member Functions

ILLUMINE_API VulkanTexture2D (const std::string &path, bool loadUnorm)
 Constructs a Vulkan texture by loading from an image file path.
ILLUMINE_API void Release () override
 Release Memory for both texture and the underlying image.
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.
Public Member Functions inherited from Raven::RefCounted
 RefCounted ()
virtual ~RefCounted ()
void IncRefCount ()
void DecRefCount ()
u32 GetRefCount () const

Additional Inherited Members

Static Public Member Functions inherited from Raven::Texture2D
static Ref< Texture2DCreate (const std::string &path, bool loadUnorm=false)
 Loads a 2D texture from a file path.
Static Public Attributes inherited from Raven::Texture2D
static constexpr AssetType ASSET_TYPE = AssetType::Texture

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()

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.

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.

◆ Release()

void Raven::VulkanTexture2D::Release ( )
overridevirtual

Release Memory for both texture and the underlying image.

Implements Raven::Texture.


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