Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DRenderFont Class Reference

The U4DRenderFont class manages the rendering of font entities. More...

Inherits U4DEngine::U4DRenderImage.

Public Member Functions

 U4DRenderFont (U4DImage *uU4DImage)
 Constructor for class. More...
 
 ~U4DRenderFont ()
 class destructor
 
void render (id< MTLRenderCommandEncoder > uRenderEncoder)
 Renders the current entity. More...
 
void updateRenderingInformation ()
 Updates the font rendering data. More...
 
void modifyRenderingInformation ()
 Modifies font rendering data if required. More...
 
void clearModelAttributeData ()
 clears all attributes containers More...
 
- Public Member Functions inherited from U4DEngine::U4DRenderImage
 U4DRenderImage (U4DImage *uU4DImage)
 Constructor for class. More...
 
 ~U4DRenderImage ()
 Destructor for class.
 
void initMTLRenderLibrary ()
 Initializes the library shaders. More...
 
void initMTLRenderPipeline ()
 Initializes the Rendering Pipeline. More...
 
virtual bool loadMTLBuffer ()
 Loads the attributes and Uniform data. More...
 
void loadMTLTexture ()
 Loads image texture into GPU. More...
 
void updateSpaceUniforms ()
 Updates the space matrix of the entity. More...
 
void render (id< MTLRenderCommandEncoder > uRenderEncoder)
 Renders the current entity. More...
 
void alignedAttributeData ()
 It aligns all attribute data. More...
 
void initTextureSamplerObjectNull ()
 Set texture sampler to NULL. More...
 
- Public Member Functions inherited from U4DEngine::U4DRenderEntity
 U4DRenderEntity ()
 Constructor for the U4DRenderEntity. More...
 
virtual ~U4DRenderEntity ()
 Destructor for the U4DRenderEntity. More...
 
void loadRenderingInformation ()
 Sends attributes information to the GPU. More...
 
virtual void loadMTLAdditionalInformation ()
 Loads additional information for different types of entities. More...
 
virtual void updateAllUniforms ()
 
virtual void createTextureObject (id< MTLTexture > &uTextureObject)
 Creates a texture object to be applied to an entity. More...
 
void createSamplerObject (id< MTLSamplerState > &uSamplerStateObject, MTLSamplerDescriptor *uSamplerDescriptor)
 Creates a sampler object required for texturing. More...
 
virtual void setGeometryLineColor (U4DVector4n &uGeometryLineColor)
 Set line color for geometric entities. More...
 
void clearRawImageData ()
 Clear the raw image data. More...
 
void setIsWithinFrustum (bool uValue)
 Sets property used to determine if entity is within frustum. More...
 
void setRawImageData (std::vector< unsigned char > uRawImageData)
 
void setImageWidth (unsigned int uImageWidth)
 
void setImageHeight (unsigned int uImageHeight)
 
bool createTextureAndSamplerObjects (id< MTLTexture > &uTextureObject, id< MTLSamplerState > &uSamplerStateObject, MTLSamplerDescriptor *uSamplerDescriptor, std::string uTextureName)
 
void setPipelineForPass (std::string uPipelineName, int uRenderPassKey)
 
void removePassPipelinePair (int uRenderPassKey)
 
U4DRenderPipelineInterfacegetPipeline (int uRenderPassKey)
 

Additional Inherited Members

- Protected Attributes inherited from U4DEngine::U4DRenderImage
std::vector< AttributeAlignedImageDataattributeAlignedContainer
 vector for the aligned attribute data. The attributes need to be aligned before they are processed by the GPU
 
MTLSamplerDescriptor * nullSamplerDescriptor
 Pointer to the null sampler descriptor used for texturing.
 
id< MTLTexture > textureObject
 Pointer that represents the texture object.
 
id< MTLSamplerState > samplerStateObject
 Pointer to the Sampler State object.
 
MTLSamplerDescriptor * samplerDescriptor
 Pointer to the Sampler descriptor.
 
- Protected Attributes inherited from U4DEngine::U4DRenderEntity
id< MTLDevice > mtlDevice
 Pointer representing a Metal Device.
 
id< MTLBuffer > attributeBuffer
 Pointer to the attribute buffer.
 
id< MTLBuffer > indicesBuffer
 Pointer to the index buffer.
 
id< MTLBuffer > uniformSpaceBuffer
 Pointer to the Uniform that holds the Space matrix.
 
bool eligibleToRender
 Variable to determine if object should be rendered.
 
bool isWithinFrustum
 Variable to determine if the 3D object is within the frustum.
 
std::vector< unsigned char > rawImageData
 buffer for the raw image data of a texture
 
unsigned int imageWidth
 Width of the texture image.
 
unsigned int imageHeight
 Height of the texture image.
 
std::map< int, U4DRenderPipelineInterface * > renderPassPipelineMap
 

Detailed Description

The U4DRenderFont class manages the rendering of font entities.

Constructor & Destructor Documentation

◆ U4DRenderFont()

U4DEngine::U4DRenderFont::U4DRenderFont ( U4DImage uU4DImage)

Constructor for class.

It sets the font entity it will manage

Parameters
uU4DImagefont entity

Member Function Documentation

◆ clearModelAttributeData()

void U4DEngine::U4DRenderFont::clearModelAttributeData ( )
virtual

clears all attributes containers

clears attributes containers such as vertices and UVs

Reimplemented from U4DEngine::U4DRenderImage.

◆ modifyRenderingInformation()

void U4DEngine::U4DRenderFont::modifyRenderingInformation ( )
virtual

Modifies font rendering data if required.

This method is called by the U4DText class. If the text container size changes, it loads a new set of attributes.

Reimplemented from U4DEngine::U4DRenderEntity.

◆ render()

void U4DEngine::U4DRenderFont::render ( id< MTLRenderCommandEncoder >  uRenderEncoder)
virtual

Renders the current entity.

Updates the space matrix and any rendering flags. It encodes the pipeline, buffers and issues the draw command

Parameters
uRenderEncoderMetal encoder object for the current entity

Reimplemented from U4DEngine::U4DRenderEntity.

◆ updateRenderingInformation()

void U4DEngine::U4DRenderFont::updateRenderingInformation ( )
virtual

Updates the font rendering data.

This method is called by the U4DText class whenever the text changes

Reimplemented from U4DEngine::U4DRenderEntity.