27 #include "glm/gtc/type_ptr.hpp" 49 return (a.
mesh <= b.
mesh ?
false :
true);
72 if (program->
glid == 0) {
75 glm::vec3 ref((*transform)[3]);
86 glm::vec3 ref((*transform)[3]);
118 if (currentProgram !=
_nodeArray[i].program) {
120 glUseProgram(currentProgram->
glid);
122 if (currentSurface != 0) {
125 if (currentMaterial != 0) {
133 if (currentMaterial !=
_nodeArray[i].material) {
134 if (currentMaterial != 0) {
145 if (currentSurface !=
_nodeArray[i].surface) {
146 if (currentSurface != 0) {
159 assert(currentSurface);
160 assert(currentMaterial);
168 while ((i < limit) && (
_nodeArray[i].mesh == currentMesh) && (
_nodeArray[i].material == currentMaterial) && (
_nodeArray[i].surface == currentSurface)) {
179 if (currentMaterial) {
182 if (currentSurface) {
187 glActiveTexture(GL_TEXTURE0);
glm::vec3 _cameraReference
Shader::ShaderMaterial * material
void clear()
Clear the queue of all items.
ShaderSurface * getSurface()
ShaderMaterial * getMaterial()
void bindFade(Shader::ShaderProgram *program, float fade)
float reference
Reference point to the camera location, primarily used for depth sorting.
void bindProgram(Shader::ShaderProgram *program)
Utility templates and functions.
void sortShader()
Sort queue elements by shader program.
Render queue, for efficient OpenGL render calls.
ShaderProgram * getProgram()
RenderQueue(uint32 precache=1000)
void queueItem(Shader::ShaderProgram *program, Shader::ShaderSurface *surface, Shader::ShaderMaterial *material, Mesh::Mesh *mesh, const glm::mat4 *transform, float alpha)
void renderBind()
Follows the steps of renderImmediate, but broken into different functions.
const glm::vec3 & getCentre() const
void sortDepth()
Sort queue elements by depth.
void bindProgramNoFade(Shader::ShaderProgram *program)
std::vector< RenderQueueNode > _nodeArray
Shader::ShaderProgram * program
void render()
Render all queued items.
void setCameraReference(const glm::vec3 &reference)
bool compareShader(const RenderQueue::RenderQueueNode &a, const RenderQueue::RenderQueueNode &b)
bool compareDepth(const RenderQueue::RenderQueueNode &a, const RenderQueue::RenderQueueNode &b)
void bindObjectModelview(Shader::ShaderProgram *program, const glm::mat4 *t)