added RenderQueue
This commit is contained in:
52
engine/RenderQueue.h
Normal file
52
engine/RenderQueue.h
Normal file
@ -0,0 +1,52 @@
|
||||
#ifndef BLUECORE_RENDER_QUEUE_H
|
||||
#define BLUECORE_RENDER_QUEUE_H
|
||||
|
||||
#include "RenderDevice.h"
|
||||
|
||||
namespace BlueCore
|
||||
{
|
||||
class RenderItem : public Referenced
|
||||
{
|
||||
public:
|
||||
virtual void render(RenderDevice *) const = 0;
|
||||
};
|
||||
|
||||
class RenderQueue : public Referenced
|
||||
{
|
||||
struct QueueItem
|
||||
{
|
||||
QueueItem(RenderItem *renderitem, const Vector3& vector,
|
||||
const Quaternion& quat) :
|
||||
item(renderitem), position(vector), orientation(quat)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ref_ptr<RenderItem> item;
|
||||
Vector3 position;
|
||||
Quaternion orientation;
|
||||
};
|
||||
|
||||
std::list<QueueItem> _OpaqueItems;
|
||||
std::list<QueueItem> _TransparentItems;
|
||||
|
||||
public:
|
||||
|
||||
void addOpaqueItem(RenderItem *item, const Vector3& position,
|
||||
const Quaternion& orientation);
|
||||
|
||||
void addTransparentItem(RenderItem *item, const Vector3& position,
|
||||
const Quaternion& orientation);
|
||||
|
||||
const std::list<QueueItem>& getOpaqueItems();
|
||||
|
||||
const std::list<QueueItem>& getTransparentItems();
|
||||
|
||||
void clear();
|
||||
|
||||
void render(RenderDevice *device) const;
|
||||
};
|
||||
|
||||
} // namespace BluewCore
|
||||
|
||||
#endif // BLUECORE_RENDER_QUEUE_H
|
Reference in New Issue
Block a user