Skip to content

Commit

Permalink
GRAPHICS: Add sorting hints to RenderManager
Browse files Browse the repository at this point in the history
  • Loading branch information
mirv-sillyfish authored and DrMcCoy committed Nov 17, 2018
1 parent 373f8b2 commit e0e647e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/graphics/render/renderman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ namespace Graphics {

namespace Render {

RenderManager::RenderManager() {
RenderManager::RenderManager() : _sortingHints(SORT_HINT_NORMAL) {
}

RenderManager::~RenderManager() {
}

void RenderManager::setSortingHint(SortingHints hint) {
_sortingHints = hint;
}

void RenderManager::setCameraReference(const glm::vec3 &reference) {
_queueColorSolid.setCameraReference(reference);
_queueColorTransparent.setCameraReference(reference);
Expand Down
11 changes: 11 additions & 0 deletions src/graphics/render/renderman.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,17 @@ namespace Render {

class RenderManager : public Common::Singleton<RenderManager> {
public:

enum SortingHints {
SORT_HINT_NORMAL = 0, // Set normal render order sorting.
SORT_HINT_ALLDEPTH = 1 // Sort _everything_ by depth. Not optimal for rendering, but some games require it.
};

RenderManager();
~RenderManager();

void setSortingHint(SortingHints hint);

void setCameraReference(const glm::vec3 &reference);

void queueRenderable(Shader::ShaderRenderable *renderable, const glm::mat4 *transform);
Expand All @@ -54,6 +62,9 @@ class RenderManager : public Common::Singleton<RenderManager> {
private:
RenderQueue _queueColorSolid;
RenderQueue _queueColorTransparent;

SortingHints _sortingHints;

//std::vector<GLContainer *> _queueColorImmediate; // For anything special outside the normal render path.
};

Expand Down

0 comments on commit e0e647e

Please sign in to comment.