Muto 0.0.1
Cross-Platform Application Template
GitHub Repo | Muto Updates | Muto's Author
Loading...
Searching...
No Matches
Muto::Texture2D Class Reference

An abstraction for a 2D texture. More...

#include <Texture.h>

Inheritance diagram for Muto::Texture2D:
Muto::Texture Muto::OpenGLTexture2D

Static Public Member Functions

static Ref< Texture2D > Create (const std::string &path)
 
static Ref< Texture2D > Create (uint32_t width, uint32_t height)
 

Additional Inherited Members

- Public Member Functions inherited from Muto::Texture
virtual void Bind (uint32_t slot=0) const =0
 Binds the texture to the specified slot for use.
 
virtual uint32_t GetHeight () const =0
 Returns the height of the texture.
 
virtual std::string GetName () const =0
 
virtual uint32_t GetRendererID () const =0
 Returns the renderer ID of the texture.
 
virtual uint32_t GetWidth () const =0
 Returns the width of the texture.
 
virtual bool operator== (const Texture2D &other) const =0
 
virtual void SetData (void *data, uint32_t size)=0
 Sets the data of the texture.
 
virtual ~Texture ()=default
 

Detailed Description

An abstraction for a 2D texture.

Member Function Documentation

◆ Create() [1/2]

Ref< Texture2D > Muto::Texture2D::Create ( const std::string &  path)
static
22 {
23 switch (Renderer::GetAPI())
24 {
25 case RenderAPI::API::RAPI_None: MU_CORE_ASSERT(false, "RenderAPI::None is currently not supported!"); return nullptr;
27 }
28 MU_CORE_ASSERT(false, "Unknown RenderAPI!");
29 return nullptr;
30 }
#define MU_CORE_ASSERT(x,...)
Definition Asserts.h:32
static RenderAPI::API GetAPI()
Retrieves the current rendering API.
Definition Renderer.h:44
constexpr Scope< T > CreateScope(Args &&... args)
Creates a Scope (unique_ptr) for the given type and constructor arguments.
Definition Defines_Macros.h:51

References Muto::Renderer::GetAPI(), Muto::RenderAPI::RAPI_None, and Muto::RenderAPI::RAPI_OpenGL.

◆ Create() [2/2]

Ref< Texture2D > Muto::Texture2D::Create ( uint32_t  width,
uint32_t  height 
)
static
11 {
12 switch (Renderer::GetAPI())
13 {
14 case RenderAPI::API::RAPI_None: MU_CORE_ASSERT(false, "RenderAPI::None is currently not supported!"); return nullptr;
16 }
17 MU_CORE_ASSERT(false, "Unknown RenderAPI!");
18 return nullptr;
19 }

References Muto::Renderer::GetAPI(), Muto::RenderAPI::RAPI_None, and Muto::RenderAPI::RAPI_OpenGL.


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