CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::GLImage Class Referencefinal

#include <CeresEngine/RenderAPI/OpenGL/GLImage.hpp>

Inheritance diagram for CeresEngine::GLImage:
CeresEngine::GPUImage CeresEngine::GLDeviceObject< GLImage, GPUImage > CeresEngine::TDeviceObject< GPUImageDescriptor, GPUResource > CeresEngine::GLObject< ChildTypeName, ParentType > CeresEngine::GPUResource CeresEngine::GPUDeviceObject CeresEngine::GPUObject

Public Member Functions

 GLImage (GLDevicePtr device, const GPUImageDescriptor &descriptor)
 
 ~GLImage () final
 
GPUImageViewPtr createView (const GPUImageViewDescriptor &descriptor) final
 
GPUImageType type () const
 
GLuint handle () const
 
void updateState (const GPUSamplerDescriptor &samplerDescriptor)
 Update the image with the given sampler descriptor.
 
- Public Member Functions inherited from CeresEngine::GPUImage
 GPUImage (const GPUImage &)=delete
 Deleted copy constructor.
 
GPUImageoperator= (const GPUImage &)=delete
 
 GPUImage (GPUImage &&)=delete
 Deleted move constructor.
 
GPUImageoperator= (GPUImage &&)=delete
 
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Inherited constructors.
 
 TDeviceObject (const TDeviceObject &)=delete
 Inherited constructors.
 
 TDeviceObject (TDeviceObject &&)=delete
 Inherited constructors.
 
- Public Member Functions inherited from CeresEngine::TDeviceObject< GPUImageDescriptor, GPUResource >
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Initializes a new RenderAPI device object instance.
 
 TDeviceObject (const TDeviceObject &)=delete
 
 TDeviceObject (TDeviceObject &&)=delete
 
 ~TDeviceObject () override=default
 
TDeviceObjectoperator= (const TDeviceObject &)=delete
 
TDeviceObjectoperator= (TDeviceObject &&)=delete
 
- Public Member Functions inherited from CeresEngine::GPUResource
 GPUDeviceObject (GPUDevice &device)
 
- Public Member Functions inherited from CeresEngine::GPUDeviceObject
 GPUDeviceObject (GPUDevice &device)
 
 ~GPUDeviceObject () override
 
- Public Member Functions inherited from CeresEngine::GPUObject
 GPUObject ()=default
 
virtual ~GPUObject ()=default
 
 GPUObject (const GPUObject &)=delete
 
GPUObjectoperator= (const GPUObject &)=delete
 
 GPUObject (GPUObject &&)=delete
 
GPUObjectoperator= (GPUObject &&)=delete
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Releases the object by decrementing it's reference count by one.
 

Private Attributes

GLObjectHandle<&glad_glGenTextures, &glad_glDeleteTexturestextureID {}
 The OpenGL device image.
 
GLImageState objectState
 The OpenGL image state cache.
 
GPUImageDescriptor mDescriptor
 The image descriptor.
 

Additional Inherited Members

- Public Types inherited from CeresEngine::TDeviceObject< GPUImageDescriptor, GPUResource >
using Descriptor = GPUImageDescriptor
 An type-alias to the descriptor struct type.
 
- Static Public Member Functions inherited from CeresEngine::GPUImage
static UInt32 numMipLevels (UInt32 width, UInt32 height=1, UInt32 depth=1) noexcept
 Returns the number of MIP-map levels for a image with the specified size.
 
static UInt32 numMipLevels (const GPUImageDescriptor &imageDesc) noexcept
 Returns the number of MIP-map levels for the specified image descriptor.
 
static UInt32 bufferSize (Format format, UInt32 numTexels) noexcept
 Returns the required buffer size (in bytes) of a image with the specified hardware format and number of texels.
 
static UInt32 size (const GPUImageDescriptor &imageDesc) noexcept
 
static bool isMipMapped (const GPUImageDescriptor &imageDesc) noexcept
 Returns true if the specified image descriptor describes a image with MIP-mapping enabled.
 
static bool isArray (GPUImageType type) noexcept
 Returns true if the specified image type is an array image.
 
static bool isMultiSample (GPUImageType type) noexcept
 Returns true if the specified image type is a multi-sample image.
 
static bool isCube (GPUImageType type) noexcept
 Returns true if the specified image type is a cube image.
 
- Static Public Member Functions inherited from CeresEngine::GLObject< ChildTypeName, ParentType >
static RC< ChildTypeNamecast (const RC< ParentType > &ptr)
 Casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName.
 
static RC< ChildTypeNamesafeCast (const RC< ParentType > &ptr)
 Safely casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName.
 
static ChildTypeNamecast (ParentType &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamecast (const ParentType &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static ChildTypeNamecast (ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamecast (const ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static ChildTypeNamesafeCast (ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamesafeCast (const ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
- Public Attributes inherited from CeresEngine::TDeviceObject< GPUImageDescriptor, GPUResource >
const Descriptordescriptor
 A structure that describes the object and it's properties.
 
- Public Attributes inherited from CeresEngine::GPUDeviceObject
GPUDevicedevice
 The owning device this object was created from.
 
- Protected Member Functions inherited from CeresEngine::GPUObject
virtual void destroy () noexcept
 A internal method called by the system when the object reference count reaches zero.
 
- Protected Member Functions inherited from CeresEngine::GLDeviceObject< GLImage, GPUImage >
 GLDeviceObject (GLDevicePtr device)
 Creates a new GLDeviceObject from the given device.
 
- Protected Attributes inherited from CeresEngine::GLDeviceObject< GLImage, GPUImage >
GLDevicedeviceGL
 The owning GLDevice instance.
 

Constructor & Destructor Documentation

◆ GLImage()

CeresEngine::GLImage::GLImage ( GLDevicePtr  device,
const GPUImageDescriptor descriptor 
)

◆ ~GLImage()

CeresEngine::GLImage::~GLImage ( )
final

Member Function Documentation

◆ createView()

GPUImageViewPtr CeresEngine::GLImage::createView ( const GPUImageViewDescriptor descriptor)
finalvirtual

Implements CeresEngine::GPUImage.

◆ handle()

GLuint CeresEngine::GLImage::handle ( ) const
inline
Returns
The OpenGL object handle

◆ type()

GPUImageType CeresEngine::GLImage::type ( ) const
inline
Returns
The image descriptor

◆ updateState()

void CeresEngine::GLImage::updateState ( const GPUSamplerDescriptor samplerDescriptor)

Update the image with the given sampler descriptor.

Parameters
samplerDescriptorThe image sample descriptor.

Member Data Documentation

◆ mDescriptor

GPUImageDescriptor CeresEngine::GLImage::mDescriptor
private

The image descriptor.

◆ objectState

GLImageState CeresEngine::GLImage::objectState
private

The OpenGL image state cache.

◆ textureID

GLObjectHandle<& glad_glGenTextures , & glad_glDeleteTextures > CeresEngine::GLImage::textureID {}
private

The OpenGL device image.


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