Vesper 0.5.1
Vesper is short form for the Latin word for "Bat", as Vesper is designed to be small, lightweight, and easily handle things like particles and flocking behaviors in accordance with the nature of bats. \n It is meant to be a particle simulation, VFX editor, and CAN be used secondarily as a small game engine.
GitHub | Vesper Updates | Creator
Loading...
Searching...
No Matches
Vesper::Texture2D Class Reference

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

#include <Texture.h>

Inheritance diagram for Vesper::Texture2D:
Vesper::Texture Vesper::OpenGLTexture2D

Static Public Member Functions

static Ref< Texture2DCreate (uint32_t width, uint32_t height)
static Ref< Texture2DCreate (const std::string &path)

Additional Inherited Members

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

Detailed Description

An abstraction for a 2D texture.

Member Function Documentation

◆ Create() [1/2]

Ref< Texture2D > Vesper::Texture2D::Create ( const std::string & path)
static
22 {
23 switch (Renderer::GetAPI())
24 {
25 case RendererAPI::API::None: VZ_CORE_ASSERT(false, "RendererAPI::None is currently not supported!"); return nullptr;
27 }
28 VZ_CORE_ASSERT(false, "Unknown RendererAPI!");
29 return nullptr;
30 }
#define VZ_CORE_ASSERT(x,...)
Definition Asserts.h:20
@ None
Definition RendererAPI.h:15
@ OpenGL
Definition RendererAPI.h:16
static RendererAPI::API GetAPI()
Retrieves the current rendering API.
Definition Renderer.h:40
constexpr Ref< T > CreateRef(Args &&... args)
Creates a Ref (shared_ptr) for the given type and constructor arguments.
Definition Defines_Macros.h:72

References Vesper::Renderer::GetAPI(), Vesper::RendererAPI::None, and Vesper::RendererAPI::OpenGL.

◆ Create() [2/2]

Ref< Texture2D > Vesper::Texture2D::Create ( uint32_t width,
uint32_t height )
static
11 {
12 switch (Renderer::GetAPI())
13 {
14 case RendererAPI::API::None: VZ_CORE_ASSERT(false, "RendererAPI::None is currently not supported!"); return nullptr;
15 case RendererAPI::API::OpenGL: return CreateRef<OpenGLTexture2D>(width, height);
16 }
17 VZ_CORE_ASSERT(false, "Unknown RendererAPI!");
18 return nullptr;
19 }

References Vesper::Renderer::GetAPI(), Vesper::RendererAPI::None, and Vesper::RendererAPI::OpenGL.


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