class mrpt::opengl::CText¶
A 2D text (bitmap rendering): it always “faces the observer” despite it’s at some 3D location.
Use setString and setFont to change the text displayed by this object.
All texts appear with the font GLUT_BITMAP_TIMES_ROMAN_10 for now (i.e. setFont is ignored)
See also:
#include <mrpt/opengl/CText.h> class CText: public mrpt::opengl::CRenderizableShaderText { public: // construction CText(const std::string& str = std::string("")); // methods void setString(const std::string& s); std::string getString() const; void setFont(const std::string& s, int height); std::string getFont() const; virtual shader_list_t requiredShaders() const; virtual void render(const RenderContext& rc) const; virtual mrpt::math::TBoundingBox getBoundingBox() const; };
Inherited Members¶
public: // structs struct RenderContext; // methods virtual void render(const RenderContext& rc) const = 0; virtual void renderUpdateBuffers() const = 0; virtual shader_list_t requiredShaders() const; virtual auto getBoundingBox() const = 0; virtual void freeOpenGLResources() = 0; virtual shader_list_t requiredShaders() const; virtual void render(const RenderContext& rc) const; virtual void renderUpdateBuffers() const; virtual void onUpdateBuffers_Text() = 0; virtual void freeOpenGLResources();
Methods¶
void setString(const std::string& s)
Sets the text to display.
std::string getString() const
Return the current text associated to this label.
void setFont(const std::string& s, int height)
Sets the font (It has no effect yet!)
virtual shader_list_t requiredShaders() const
Returns the ID of the OpenGL shader program required to render this class.
See also:
virtual void render(const RenderContext& rc) const
Implements the rendering of 3D objects in each class derived from CRenderizable.
This can be called more than once (one per required shader program) if the object registered several shaders.
See also:
virtual mrpt::math::TBoundingBox getBoundingBox() const
Evaluates the bounding box of this object (including possible children) in the coordinate frame of the object parent.