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

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

#include <Texture.h>

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

Static Public Member Functions

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.

Additional Inherited Members

Public Member Functions inherited from Raven::Texture
virtual ~Texture ()=default
 Virtual destructor.
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.

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() [1/3]

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.

◆ Create() [2/3]

Ref< Texture2D > Raven::Texture2D::Create ( const TextureSpecification & specification)
static

Creates a 2D texture from a TextureSpecification.

Parameters
specificationThe TextureSpecification detailing properties.
Returns
Ref to the created Texture2D.

◆ Create() [3/3]

Ref< Texture2D > Raven::Texture2D::Create ( u32 width,
u32 height )
static

Creates a 2D texture with given width and height.

Parameters
widthWidth of the texture in pixels.
heightHeight of the texture in pixels.
Returns
Ref to the created Texture2D.

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