Simple game engine with complete export to scripting language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

53 lines
1.2 KiB

#include "RenderQueue.h"
namespace BlueCore
{
void RenderQueue::addOpaqueItem(RenderItem *item, const Vector3& position,
const Quaternion& orientation)
{
_OpaqueItems.push_back(QueueItem(item, position, orientation));
}
void RenderQueue::addTransparentItem(RenderItem *item, const Vector3& position,
const Quaternion& orientation)
{
_TransparentItems.push_back(QueueItem(item, position, orientation));
}
const std::list<RenderQueue::QueueItem>& RenderQueue::getOpaqueItems()
{
return _OpaqueItems;
}
const std::list<RenderQueue::QueueItem>& RenderQueue::getTransparentItems()
{
return _TransparentItems;
}
void RenderQueue::clear()
{
_OpaqueItems.clear();
_TransparentItems.clear();
}
void RenderQueue::render(RenderDevice *device) const
{
std::list<QueueItem>::const_iterator i;
for (i = _OpaqueItems.begin(); i != _OpaqueItems.end(); i++)
{
device->pushTransformation((*i).position, (*i).orientation);
(*i).item->render(device);
device->popTransformation();
}
for (i = _TransparentItems.begin(); i != _TransparentItems.end(); i++)
{
device->pushTransformation((*i).position, (*i).orientation);
(*i).item->render(device);
device->popTransformation();
}
}
}