Commit 55ee4612 authored by Christopher Tenter's avatar Christopher Tenter

support for immediate mode in new renderer

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15868 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 5fc620e2
...@@ -368,6 +368,8 @@ void Renderer::bindObjectRenderStates(ACG::RenderObject* _obj) ...@@ -368,6 +368,8 @@ void Renderer::bindObjectRenderStates(ACG::RenderObject* _obj)
void Renderer::drawObject(ACG::RenderObject* _obj) void Renderer::drawObject(ACG::RenderObject* _obj)
{ {
if (_obj->numIndices)
{
// indexed drawing? // indexed drawing?
bool noIndices = true; bool noIndices = true;
if (_obj->indexBuffer || _obj->sysmemIndexBuffer) if (_obj->indexBuffer || _obj->sysmemIndexBuffer)
...@@ -392,6 +394,12 @@ void Renderer::drawObject(ACG::RenderObject* _obj) ...@@ -392,6 +394,12 @@ void Renderer::drawObject(ACG::RenderObject* _obj)
glDrawElements(_obj->primitiveMode, _obj->numIndices, _obj->indexType, glDrawElements(_obj->primitiveMode, _obj->numIndices, _obj->indexType,
((const char*)_obj->sysmemIndexBuffer) + _obj->indexOffset * indexSize); ((const char*)_obj->sysmemIndexBuffer) + _obj->indexOffset * indexSize);
} }
}
else
{
// user defined draw-call
_obj->executeImmediateMode();
}
} }
void Renderer::renderObject(ACG::RenderObject* _obj, void Renderer::renderObject(ACG::RenderObject* _obj,
......
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