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

Factory and concrete interface for 2D textures. More...

#include <Texture.h>

Inherits Raven::Texture.

Inherited by Raven::VulkanTexture2D.

Static Public Member Functions

static Ref< Texture2DCreate (const std::string &path, bool loadUnorm=false)
 Loads a 2D texture from a file path.

Static Public Attributes

static constexpr AssetType ASSET_TYPE = AssetType::Texture

Additional Inherited Members

Public Member Functions inherited from Raven::Texture
virtual ~Texture ()=default
 Virtual destructor.
virtual void Release ()=0
 Release Memory for both texture and the underlying image.
virtual TextureSpecificationGetSpecification ()=0
 Accesses the texture's specification.
virtual const TextureSpecificationGetSpecification () const =0
 Accesses the texture's specification (const version).
virtual u32 GetWidth () const =0
 Retrieves the width of the texture in pixels.
virtual u32 GetHeight () const =0
 Retrieves the height of the texture in pixels.
virtual const std::string & GetPath () const =0
 Retrieves the original file path the texture was loaded from.
virtual Ref< Image2DGetImage () const =0
 Retrieves the underlying Image2D resource.
Public Member Functions inherited from Raven::RefCounted
 RefCounted ()
virtual ~RefCounted ()
void IncRefCount ()
void DecRefCount ()
u32 GetRefCount () const

Detailed Description

Factory and concrete interface for 2D textures.

Provides static methods to create 2D textures:

  • Empty textures with specified width and height.
  • Textures from a detailed TextureSpecification.
  • Textures loaded from file paths.

Member Function Documentation

◆ Create()

Ref< Texture2D > Raven::Texture2D::Create ( const std::string & path,
bool loadUnorm = false )
static

Loads a 2D texture from a file path.

Parameters
pathThe file path to the texture image.
loadUnormSpecifies whether or not the texture is supposed to have ImageFormat::RGBA8_UNORM.
Returns
Ref to the created Texture2D.

Member Data Documentation

◆ ASSET_TYPE

AssetType Raven::Texture2D::ASSET_TYPE = AssetType::Texture
inlinestaticconstexpr

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