diff --git a/common/gal/opengl/vertex_manager.cpp b/common/gal/opengl/vertex_manager.cpp index 4f65608ff9..c9e7c5a655 100644 --- a/common/gal/opengl/vertex_manager.cpp +++ b/common/gal/opengl/vertex_manager.cpp @@ -49,7 +49,7 @@ VERTEX_MANAGER::VERTEX_MANAGER( bool aCached ) : } -void VERTEX_MANAGER::Reserve( unsigned int aSize ) +bool VERTEX_MANAGER::Reserve( unsigned int aSize ) { assert( m_reservedSpace == 0 && m_reserved == NULL ); @@ -66,14 +66,16 @@ void VERTEX_MANAGER::Reserve( unsigned int aSize ) show_err = false; } - return; + return false; } m_reservedSpace = aSize; + + return true; } -void VERTEX_MANAGER::Vertex( GLfloat aX, GLfloat aY, GLfloat aZ ) +bool VERTEX_MANAGER::Vertex( GLfloat aX, GLfloat aY, GLfloat aZ ) { // flag to avoid hanging by calling DisplayError too many times: static bool show_err = true; @@ -102,14 +104,16 @@ void VERTEX_MANAGER::Vertex( GLfloat aX, GLfloat aY, GLfloat aZ ) show_err = false; } - return; + return false; } putVertex( *newVertex, aX, aY, aZ ); + + return true; } -void VERTEX_MANAGER::Vertices( const VERTEX aVertices[], unsigned int aSize ) +bool VERTEX_MANAGER::Vertices( const VERTEX aVertices[], unsigned int aSize ) { // flag to avoid hanging by calling DisplayError too many times: static bool show_err = true; @@ -125,7 +129,7 @@ void VERTEX_MANAGER::Vertices( const VERTEX aVertices[], unsigned int aSize ) show_err = false; } - return; + return false; } // Put vertices in already allocated memory chunk @@ -133,6 +137,8 @@ void VERTEX_MANAGER::Vertices( const VERTEX aVertices[], unsigned int aSize ) { putVertex( newVertex[i], aVertices[i].x, aVertices[i].y, aVertices[i].z ); } + + return true; } diff --git a/include/gal/opengl/vertex_manager.h b/include/gal/opengl/vertex_manager.h index c7455aecea..8bc89655e7 100644 --- a/include/gal/opengl/vertex_manager.h +++ b/include/gal/opengl/vertex_manager.h @@ -63,8 +63,9 @@ public: * allocates space for vertices, so it will be used with subsequent Vertex() calls. * * @param aSize is the number of vertices that should be available in the reserved space. + * @return True if successful, false otherwise. */ - void Reserve( unsigned int aSize ); + bool Reserve( unsigned int aSize ); /** * Function Vertex() @@ -74,10 +75,11 @@ public: * matrix applied. * * @param aVertex contains vertex coordinates. + * @return True if successful, false otherwise. */ - inline void Vertex( const VERTEX& aVertex ) + inline bool Vertex( const VERTEX& aVertex ) { - Vertex( aVertex.x, aVertex.y, aVertex.z ); + return Vertex( aVertex.x, aVertex.y, aVertex.z ); } /** @@ -88,8 +90,9 @@ public: * @param aX is the X coordinate of the new vertex. * @param aY is the Y coordinate of the new vertex. * @param aZ is the Z coordinate of the new vertex. + * @return True if successful, false otherwise. */ - void Vertex( GLfloat aX, GLfloat aY, GLfloat aZ ); + bool Vertex( GLfloat aX, GLfloat aY, GLfloat aZ ); /** * Function Vertices() @@ -101,8 +104,9 @@ public: * * @param aVertices contains vertices to be added * @param aSize is the number of vertices to be added. + * @return True if successful, false otherwise. */ - void Vertices( const VERTEX aVertices[], unsigned int aSize ); + bool Vertices( const VERTEX aVertices[], unsigned int aSize ); /** * Function Color()