HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RV_TextRender Class Reference

Vulkan text rendering class for viewport UI elements. More...

#include <RV_TextRender.h>

Public Member Functions

 RV_TextRender ()
 
 ~RV_TextRender ()
 
 RV_TextRender (const RV_TextRender &)=delete
 
RV_TextRenderoperator= (const RV_TextRender &)=delete
 
void beginText (RV_Render *r, const UT_DimRect &viewport)
 
void addText (const char *text, RE_Font &font, fpreal32 x, fpreal32 y, const UT_Color &color, fpreal32 alpha=1.0f)
 
void addText (const char *text, RE_Font &font, fpreal32 x, fpreal32 y, fpreal32 z, const UT_Color &color, fpreal32 alpha=1.0f)
 
void endText ()
 
void render (RV_Render *r)
 Render the text. More...
 
void render (RV_Render *r, const UT_DimRect &viewport)
 
void render (RV_Render *r, const UT_Matrix4F &proj)
 
void clear ()
 Clear the text entries. More...
 
void setEnableBlending (bool val)
 
void setPreserveDepthState (bool val)
 
bool hasText () const
 Check if there is any text to render. More...
 
int numEntries () const
 Get the number of text entries awaiting rendering. More...
 

Static Public Member Functions

static void renderText (RV_Render *r, RE_Font &font, const char *text, fpreal32 x, fpreal32 y, fpreal32 z, const UT_Color &color, fpreal32 alpha, const UT_DimRect &viewport)
 
static void renderText (RV_Render *r, RE_Font &font, const char *text, fpreal32 x, fpreal32 y, const UT_Color &color, fpreal32 alpha, const UT_DimRect &viewport)
 
static void renderTextWithShadow (RV_Render *r, RE_Font &font, const char *text, fpreal32 x, fpreal32 y, fpreal32 z, const UT_Color &text_color, const UT_Color &shadow_color, fpreal32 alpha_scale, const UT_DimRect &viewport)
 Convienience function to render text with a soft shadow (1 px offset) More...
 
static void renderTextWithShadow (RV_Render *r, RE_Font &font, const char *text, fpreal32 x, fpreal32 y, const UT_Color &text_color, const UT_Color &shadow_color, fpreal32 alpha_scale, const UT_DimRect &viewport)
 
static void cleanup ()
 

Detailed Description

Vulkan text rendering class for viewport UI elements.

Definition at line 73 of file RV_TextRender.h.

Constructor & Destructor Documentation

RV_TextRender::RV_TextRender ( )
RV_TextRender::~RV_TextRender ( )
RV_TextRender::RV_TextRender ( const RV_TextRender )
delete

Member Function Documentation

void RV_TextRender::addText ( const char *  text,
RE_Font font,
fpreal32  x,
fpreal32  y,
const UT_Color color,
fpreal32  alpha = 1.0f 
)

Add a text string to be rendered with the given font, position, and color.

void RV_TextRender::addText ( const char *  text,
RE_Font font,
fpreal32  x,
fpreal32  y,
fpreal32  z,
const UT_Color color,
fpreal32  alpha = 1.0f 
)

Add a text string to be rendered with the given font, position, depth, and color.

void RV_TextRender::beginText ( RV_Render r,
const UT_DimRect viewport 
)

Initialize text rendering with the given viewport. Clears any existing text entries.

static void RV_TextRender::cleanup ( )
static
void RV_TextRender::clear ( )

Clear the text entries.

void RV_TextRender::endText ( )

Build the geometry and texture data needed for rendering. Needs to be called after beginText() and before render().

bool RV_TextRender::hasText ( ) const
inline

Check if there is any text to render.

Definition at line 125 of file RV_TextRender.h.

int RV_TextRender::numEntries ( ) const
inline

Get the number of text entries awaiting rendering.

Definition at line 128 of file RV_TextRender.h.

RV_TextRender& RV_TextRender::operator= ( const RV_TextRender )
delete
void RV_TextRender::render ( RV_Render r)

Render the text.

void RV_TextRender::render ( RV_Render r,
const UT_DimRect viewport 
)
void RV_TextRender::render ( RV_Render r,
const UT_Matrix4F proj 
)
static void RV_TextRender::renderText ( RV_Render r,
RE_Font font,
const char *  text,
fpreal32  x,
fpreal32  y,
fpreal32  z,
const UT_Color color,
fpreal32  alpha,
const UT_DimRect viewport 
)
static

Render text directly. This should be used for simple single-string rendering as it does not batch render calls.

static void RV_TextRender::renderText ( RV_Render r,
RE_Font font,
const char *  text,
fpreal32  x,
fpreal32  y,
const UT_Color color,
fpreal32  alpha,
const UT_DimRect viewport 
)
inlinestatic

Definition at line 144 of file RV_TextRender.h.

static void RV_TextRender::renderTextWithShadow ( RV_Render r,
RE_Font font,
const char *  text,
fpreal32  x,
fpreal32  y,
fpreal32  z,
const UT_Color text_color,
const UT_Color shadow_color,
fpreal32  alpha_scale,
const UT_DimRect viewport 
)
static

Convienience function to render text with a soft shadow (1 px offset)

static void RV_TextRender::renderTextWithShadow ( RV_Render r,
RE_Font font,
const char *  text,
fpreal32  x,
fpreal32  y,
const UT_Color text_color,
const UT_Color shadow_color,
fpreal32  alpha_scale,
const UT_DimRect viewport 
)
inlinestatic

Definition at line 170 of file RV_TextRender.h.

void RV_TextRender::setEnableBlending ( bool  val)
inline

Definition at line 121 of file RV_TextRender.h.

void RV_TextRender::setPreserveDepthState ( bool  val)
inline

Definition at line 122 of file RV_TextRender.h.


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