luna engine
software engine
Loading...
Searching...
No Matches
luna::renderer::texture Class Referenceabstract

base texture class. More...

#include <texture.h>

Inheritance diagram for luna::renderer::texture:

Public Member Functions

virtual ~texture ()=default
 
virtual uint32_t getWidth () const =0
 
virtual uint32_t getHeight () const =0
 
virtual const std::string & getPath () const =0
 
virtual void setData (void *data, uint32_t size)=0
 
virtual void bind (uint32_t slot=0) const =0
 
virtual bool isLoaded () const =0
 
void setDestroy (const bool &destroy)
 
void setUv (const glm::vec2 &_uvStart, const glm::vec2 &_uvEnd)
 
std::vector< glm::vec2 > getUv ()
 
uint64_t handle ()
 

Static Public Member Functions

static ref< texturecreate (const std::string &filePath)
 
static ref< texturecreate (const uint64_t &handle, const glm::vec2 &dimensions)
 

Protected Attributes

bool destroy = true
 
uint64_t _handle
 
void * data
 
uint32_t width
 
uint32_t height
 
glm::vec2 uvStart = {0.0f,0.0f}
 
glm::vec2 uvEnd = { 1.0f,1.0f }
 

Detailed Description

base texture class.

Note
see specific platform implementation for explenation with functions

Constructor & Destructor Documentation

◆ ~texture()

virtual luna::renderer::texture::~texture ( )
virtualdefault

Member Function Documentation

◆ bind()

virtual void luna::renderer::texture::bind ( uint32_t  slot = 0) const
pure virtual

Implemented in luna::vulkan::vulkanTexture.

◆ create() [1/2]

ref< texture > luna::renderer::texture::create ( const std::string &  filePath)
static

◆ create() [2/2]

ref< texture > luna::renderer::texture::create ( const uint64_t &  handle,
const glm::vec2 &  dimensions 
)
static

◆ getHeight()

virtual uint32_t luna::renderer::texture::getHeight ( ) const
pure virtual

Implemented in luna::vulkan::vulkanTexture.

◆ getPath()

virtual const std::string & luna::renderer::texture::getPath ( ) const
pure virtual

Implemented in luna::vulkan::vulkanTexture.

◆ getUv()

std::vector< glm::vec2 > luna::renderer::texture::getUv ( )
inline

◆ getWidth()

virtual uint32_t luna::renderer::texture::getWidth ( ) const
pure virtual

Implemented in luna::vulkan::vulkanTexture.

◆ handle()

uint64_t luna::renderer::texture::handle ( )
inline

◆ isLoaded()

virtual bool luna::renderer::texture::isLoaded ( ) const
pure virtual

Implemented in luna::vulkan::vulkanTexture.

◆ setData()

virtual void luna::renderer::texture::setData ( void *  data,
uint32_t  size 
)
pure virtual

Implemented in luna::vulkan::vulkanTexture.

◆ setDestroy()

void luna::renderer::texture::setDestroy ( const bool &  destroy)
inline

◆ setUv()

void luna::renderer::texture::setUv ( const glm::vec2 &  _uvStart,
const glm::vec2 &  _uvEnd 
)
inline

Member Data Documentation

◆ _handle

uint64_t luna::renderer::texture::_handle
protected

◆ data

void* luna::renderer::texture::data
protected

◆ destroy

bool luna::renderer::texture::destroy = true
protected

◆ height

uint32_t luna::renderer::texture::height
protected

◆ uvEnd

glm::vec2 luna::renderer::texture::uvEnd = { 1.0f,1.0f }
protected

◆ uvStart

glm::vec2 luna::renderer::texture::uvStart = {0.0f,0.0f}
protected

◆ width

uint32_t luna::renderer::texture::width
protected

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