Commit af59d28c authored by Christopher Tenter's avatar Christopher Tenter

name for renderobjects

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@19854 383ad7c9-94d9-4d36-a494-682f7c89f535
parent b5a792fc
...@@ -102,6 +102,13 @@ IRenderer::~IRenderer() ...@@ -102,6 +102,13 @@ IRenderer::~IRenderer()
void IRenderer::addRenderObject(ACG::RenderObject* _renderObject) void IRenderer::addRenderObject(ACG::RenderObject* _renderObject)
{ {
// avoid null-ptr access
if (!_renderObject->debugName)
_renderObject->debugName = "<unnamed>";
if (_renderObject->name.empty())
_renderObject->name = _renderObject->debugName;
// do some more checks for error detection // do some more checks for error detection
if (!_renderObject->vertexDecl && !_renderObject->vertexArrayObject) if (!_renderObject->vertexDecl && !_renderObject->vertexArrayObject)
std::cout << "error: missing vertex declaration in renderobject: " << _renderObject->debugName << std::endl; std::cout << "error: missing vertex declaration in renderobject: " << _renderObject->debugName << std::endl;
......
...@@ -101,7 +101,6 @@ struct ACGDLLEXPORT RenderObject ...@@ -101,7 +101,6 @@ struct ACGDLLEXPORT RenderObject
/** default constructor /** default constructor
* set all members to OpenGL default values * set all members to OpenGL default values
* keep renderobject a POD to avoid possible problems (update: it's not anymore, nevermind then..)
*/ */
RenderObject(); RenderObject();
...@@ -116,6 +115,11 @@ struct ACGDLLEXPORT RenderObject ...@@ -116,6 +115,11 @@ struct ACGDLLEXPORT RenderObject
*/ */
int priority; int priority;
/** \brief Name for logging
*
*/
std::string name;
/** \brief Layer based rendering /** \brief Layer based rendering
* *
* The renderer currently supports two layers: * The renderer currently supports two layers:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment