59 CRenderizableDisplayList::CRenderizableDisplayList() :
73 obj.dls_to_delete_cs.enter();
74 obj.dls_to_delete.push_back(
m_dl);
75 obj.dls_to_delete_cs.leave();
83 #if MRPT_HAS_OPENGL_GLUT 93 if (!
obj.dls_to_delete.empty())
95 obj.dls_to_delete_cs.enter();
96 #if MRPT_HAS_OPENGL_GLUT 97 for (
size_t i=0;i<
obj.dls_to_delete.size();i++)
100 obj.dls_to_delete.clear();
101 obj.dls_to_delete_cs.leave();
108 std::cerr <<
"glGenLists: Error" << std::endl;
116 std::cerr <<
"glNewList: Error" << std::endl;
123 std::cerr <<
"glEndList: Error" << std::endl;
Recursive mutex: allow recursive locks by the owner thread.
bool m_dl_recreate
If using display lists, this is true when the list must be updated (the object changes, it's the first rendering, etc...).
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
GLAPI GLuint GLAPIENTRY glGenLists(GLsizei range)
std::vector< unsigned int > dls_to_delete
static TAuxDLData * m_pInstance
The base class of 3D objects that can be directly rendered through OpenGL.
GLAPI void GLAPIENTRY glDeleteLists(GLuint list, GLsizei range)
virtual bool should_skip_display_list_cache() const
Optional: If the object has some state in which creating a display list is NOT preferred over direct ...
GLsizei GLsizei GLuint * obj
void render() const MRPT_OVERRIDE
Render the object, regenerating the display list if needed, otherwise just calling it...
unsigned int m_dl
Display list ID, for derived classes that want to use it (it's automatically deleted and freed on des...
virtual void render_dl() const =0
Derived classes must implement this method to the render the object.
A renderizable object suitable for rendering with OpenGL's display lists.
#define IMPLEMENTS_VIRTUAL_SERIALIZABLE(class_name, base_class_name, NameSpace)
This must be inserted as implementation of some required members for virtual CSerializable classes: ...
GLAPI void GLAPIENTRY glNewList(GLuint list, GLenum mode)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define INVALID_DISPLAY_LIST_ID
mrpt::synch::CCriticalSectionRecursive dls_to_delete_cs
static TAuxDLData & getSingleton()
GLAPI GLenum GLAPIENTRY glGetError(void)
The namespace for 3D scene representation and rendering.
virtual ~CRenderizableDisplayList()
GLAPI void GLAPIENTRY glEndList(void)
GLAPI void GLAPIENTRY glCallList(GLuint list)