Now sort models according to depth.

This commit is contained in:
Tleety
2016-01-11 14:12:54 +01:00
parent 0cf8d26557
commit 3c5966d174
5 changed files with 30 additions and 2 deletions
+3
View File
@@ -9,6 +9,7 @@
#include "Camera.h"
#include "RenderQueue.h"
#include "Model.h"
#include "../Core/World.h"
class IRenderer
{
@@ -34,6 +35,8 @@ public:
virtual void Update(double dt) = 0;
virtual void Draw(RenderQueueCollection& rq) = 0;
World* m_World; //Temp world, untill viktor merge.
protected:
Rectangle m_Resolution = Rectangle::Rectangle(1280, 720);
bool m_Fullscreen = false;
+4 -1
View File
@@ -23,7 +23,7 @@
class Renderer : public IRenderer
{
public:
Renderer(EventBroker* eventBroker)
Renderer(EventBroker* eventBroker)
: m_EventBroker(eventBroker)
{ }
@@ -61,6 +61,9 @@ private:
//void PickingPass(RenderQueueCollection& rq);
void DrawScreenQuad(GLuint textureToDraw);
static bool DepthSort(const std::shared_ptr<RenderJob> &i, const std::shared_ptr<RenderJob> &j) { return (i->Depth < j->Depth); }
void FillDepth(RenderQueueCollection& rq);
void GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type);
//--------------------ShaderPrograms-------------------//
ShaderProgram* m_BasicForwardProgram;