2016-08-22 12:00:25 +00:00
|
|
|
#ifndef __QDRAWER_H
|
|
|
|
#define __QDRAWER_H
|
|
|
|
|
|
|
|
#include "gl/data/gl_vertexbuffer.h"
|
|
|
|
|
|
|
|
class FQuadDrawer
|
|
|
|
{
|
|
|
|
FFlatVertex *p;
|
|
|
|
int ndx;
|
|
|
|
static FFlatVertex buffer[4];
|
|
|
|
|
|
|
|
void DoRender(int type);
|
|
|
|
public:
|
|
|
|
|
|
|
|
FQuadDrawer()
|
|
|
|
{
|
2016-08-22 13:31:23 +00:00
|
|
|
if (gl.buffermethod == BM_DEFERRED)
|
2016-08-22 12:00:25 +00:00
|
|
|
{
|
|
|
|
p = buffer;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
p = GLRenderer->mVBO->Alloc(4, &ndx);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void Set(int ndx, float x, float y, float z, float s, float t)
|
|
|
|
{
|
|
|
|
p[ndx].Set(x, y, z, s, t);
|
|
|
|
}
|
|
|
|
void Render(int type)
|
|
|
|
{
|
2016-08-22 13:31:23 +00:00
|
|
|
if (gl.buffermethod == BM_DEFERRED)
|
2016-08-22 12:00:25 +00:00
|
|
|
{
|
|
|
|
DoRender(type);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GLRenderer->mVBO->RenderArray(type, ndx, 4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|