class mrpt::opengl::CRenderizableShaderTexturedTriangles

Renderizable generic renderer for objects using the triangles-with-a-texture shader.

See also:

CTexturedPlane, opengl::CSetOfTexturedTriangles

#include <mrpt/opengl/CRenderizableShaderTexturedTriangles.h>

class CRenderizableShaderTexturedTriangles: public mrpt::opengl::CRenderizable
{
public:
    // structs

    struct texture_name_unit_t;

    // construction

    CRenderizableShaderTexturedTriangles();

    //
methods

    virtual shader_list_t requiredShaders() const;
    virtual void render(const RenderContext& rc) const;
    virtual void renderUpdateBuffers() const;
    virtual void onUpdateBuffers_TexturedTriangles() = 0;
    virtual void freeOpenGLResources();
    void assignImage(const mrpt::img::CImage& img);
};

// direct descendants

class CMesh;
class CSetOfTexturedTriangles;
class CTexturedPlane;

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;

Methods

virtual shader_list_t requiredShaders() const

Returns the ID of the OpenGL shader program required to render this class.

See also:

DefaultShaderID

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:

renderUpdateBuffers

virtual void renderUpdateBuffers() const

Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.

before they are sent for rendering in render()

virtual void onUpdateBuffers_TexturedTriangles() = 0

Must be implemented in derived classes to update the geometric entities to be drawn in “m_*_buffer” fields.

virtual void freeOpenGLResources()

Free opengl buffers.

void assignImage(const mrpt::img::CImage& img)

Assigns a texture image, and disable transparency.

Images are copied, the original ones can be deleted.