CoriEngine
Loading...
Searching...
No Matches
Cori::Graphics::Internal::OpenGLTexture2D Class Referencefinal

#include <GL_Texture.hpp>

Inheritance diagram for Cori::Graphics::Internal::OpenGLTexture2D:
Collaboration diagram for Cori::Graphics::Internal::OpenGLTexture2D:

Public Types

enum  PixelFormat { RGBA8888 , RGB888 }
 Available pixel formats. More...
enum  WrapMode { CLAMP_TO_EDGE , CLAMP_TO_BORDER , REPEAT }
 Available wrap modes. More...
enum  Filter { LINEAR , NEAREST }
 Available filtering options. More...

Public Member Functions

 OpenGLTexture2D ()
 ~OpenGLTexture2D () override
void Upload (const void *pixelData, const uint32_t width, const uint32_t height, const Params &params) override
void Bind (uint32_t slot) const override
 Binds the texture to the slot.
uint32_t GetWidth () const override
 Gives the texture width.
uint32_t GetHeight () const override
 Gives the texture height.
bool HasSemiTransparency () const override
 Checks if texture has semi transparency.
AssetStatus GetStatus () const

Static Public Member Functions

static std::shared_ptr< Texture2DCreate (const std::shared_ptr< Image > &image)
 Creates a Texture2D from the Image.
static std::shared_ptr< Texture2DCreate (const void *pixelData, const uint32_t width, const uint32_t height, const Params &params)
 Creates a Texture2D.

Protected Attributes

AssetStatus m_Status { AssetStatus::UNSPECIFIED }

Detailed Description

Definition at line 8 of file GL_Texture.hpp.

Member Enumeration Documentation

◆ Filter

Available filtering options.

Enumerator
LINEAR 
NEAREST 

Definition at line 38 of file Texture.hpp.

◆ PixelFormat

Available pixel formats.

Enumerator
RGBA8888 
RGB888 

Definition at line 24 of file Texture.hpp.

◆ WrapMode

Available wrap modes.

Enumerator
CLAMP_TO_EDGE 
CLAMP_TO_BORDER 
REPEAT 

Definition at line 31 of file Texture.hpp.

Constructor & Destructor Documentation

◆ OpenGLTexture2D()

Cori::Graphics::Internal::OpenGLTexture2D::OpenGLTexture2D ( )

Definition at line 76 of file GL_Texture.cpp.

◆ ~OpenGLTexture2D()

Cori::Graphics::Internal::OpenGLTexture2D::~OpenGLTexture2D ( )
override

Definition at line 80 of file GL_Texture.cpp.

Member Function Documentation

◆ Bind()

void Cori::Graphics::Internal::OpenGLTexture2D::Bind ( uint32_t slot) const
overridevirtual

Binds the texture to the slot.

Parameters
slotSlot to bound the texture to.
Note
Don't touch this if you're not using it outside the provided Renderer2D.

Implements Cori::Graphics::Texture.

Definition at line 85 of file GL_Texture.cpp.

◆ Create() [1/2]

std::shared_ptr< Texture2D > Cori::Graphics::Texture2D::Create ( const std::shared_ptr< Image > & image)
staticnodiscardinherited

Creates a Texture2D from the Image.

Parameters
imageImage to create Texture2D from.
Returns
Shared pointer to the created Texture2D.

Definition at line 7 of file Texture.cpp.

Here is the call graph for this function:

◆ Create() [2/2]

std::shared_ptr< Texture2D > Cori::Graphics::Texture2D::Create ( const void * pixelData,
const uint32_t width,
const uint32_t height,
const Params & params )
staticnodiscardinherited

Creates a Texture2D.

Parameters
pixelDataPixel data to create Texture2D from.
widthWidth of the source picture data.
heightHeight of the source picture data.
paramsParameters to create a texture with.
Returns
Shared pointer to the created Texture2D.

Definition at line 13 of file Texture.cpp.

Here is the call graph for this function:

◆ GetHeight()

uint32_t Cori::Graphics::Internal::OpenGLTexture2D::GetHeight ( ) const
inlinenodiscardoverridevirtual

Gives the texture height.

Returns
Texture height.

Implements Cori::Graphics::Texture.

Definition at line 18 of file GL_Texture.hpp.

◆ GetStatus()

AssetStatus Cori::Graphics::Texture::GetStatus ( ) const
inlineinherited

Definition at line 88 of file Texture.hpp.

◆ GetWidth()

uint32_t Cori::Graphics::Internal::OpenGLTexture2D::GetWidth ( ) const
inlinenodiscardoverridevirtual

Gives the texture width.

Returns
Texture width.

Implements Cori::Graphics::Texture.

Definition at line 17 of file GL_Texture.hpp.

◆ HasSemiTransparency()

bool Cori::Graphics::Internal::OpenGLTexture2D::HasSemiTransparency ( ) const
nodiscardoverridevirtual

Checks if texture has semi transparency.

Returns

Implements Cori::Graphics::Texture.

Definition at line 90 of file GL_Texture.cpp.

◆ Upload()

void Cori::Graphics::Internal::OpenGLTexture2D::Upload ( const void * pixelData,
const uint32_t width,
const uint32_t height,
const Params & params )
overridevirtual

Implements Cori::Graphics::Texture2D.

Definition at line 7 of file GL_Texture.cpp.

Member Data Documentation

◆ m_Status

AssetStatus Cori::Graphics::Texture::m_Status { AssetStatus::UNSPECIFIED }
protectedinherited

Definition at line 93 of file Texture.hpp.


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