Fix compile

This commit is contained in:
vlj 2014-05-18 23:28:39 +02:00
parent 0ccac4c552
commit 31487814fe
4 changed files with 6 additions and 13 deletions

View File

@ -31,7 +31,6 @@
#include "graphics/post_processing.hpp"
#include "graphics/referee.hpp"
#include "graphics/shaders.hpp"
#include "graphics/shadow_importance.hpp"
#include "graphics/stkanimatedmesh.hpp"
#include "graphics/stkbillboard.hpp"
#include "graphics/stkmeshscenenode.hpp"

View File

@ -33,7 +33,6 @@
#include "graphics/rtts.hpp"
#include "graphics/screenquad.hpp"
#include "graphics/shaders.hpp"
#include "graphics/shadow_importance.hpp"
#include "graphics/stkmeshscenenode.hpp"
#include "graphics/stkinstancedscenenode.hpp"
#include "graphics/wind.hpp"
@ -713,8 +712,7 @@ void IrrDriver::renderShadows()
glDisable(GL_BLEND);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.5, 0.);
glBindFramebuffer(GL_FRAMEBUFFER, m_rtts->getShadowFBO());
glViewport(0, 0, 1024, 1024);
m_rtts->getShadowFBO().Bind();
glClear(GL_DEPTH_BUFFER_BIT);
glDrawBuffer(GL_NONE);

View File

@ -139,18 +139,14 @@ RTT::RTT(size_t width, size_t height)
if (irr_driver->getGLSLVersion() >= 150)
{
glGenFramebuffers(1, &shadowFBO);
glBindFramebuffer(GL_FRAMEBUFFER, shadowFBO);
glGenTextures(1, &shadowColorTex);
glBindTexture(GL_TEXTURE_2D_ARRAY, shadowColorTex);
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_R8, 1024, 1024, 4, 0, GL_RED, GL_UNSIGNED_BYTE, 0);
glGenTextures(1, &shadowDepthTex);
glBindTexture(GL_TEXTURE_2D_ARRAY, shadowDepthTex);
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_DEPTH_COMPONENT24, 1024, 1024, 4, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0);
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, shadowColorTex, 0);
glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, shadowDepthTex, 0);
GLenum result = glCheckFramebufferStatus(GL_FRAMEBUFFER);
assert(result == GL_FRAMEBUFFER_COMPLETE_EXT);
shadowFBO = FrameBuffer(std::vector<GLuint> {shadowColorTex}, shadowDepthTex, 1024, 1024);
}
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
@ -161,7 +157,6 @@ RTT::~RTT()
glDeleteTextures(1, &DepthStencilTexture);
if (irr_driver->getGLSLVersion() >= 150)
{
glDeleteFramebuffers(1, &shadowFBO);
glDeleteTextures(1, &shadowColorTex);
glDeleteTextures(1, &shadowDepthTex);
}

View File

@ -37,7 +37,7 @@ public:
RTT(size_t width, size_t height);
~RTT();
unsigned getShadowFBO() const { return shadowFBO; }
FrameBuffer &getShadowFBO() { return shadowFBO; }
unsigned getShadowDepthTex() const { return shadowDepthTex; }
unsigned getDepthStencilTexture() const { return DepthStencilTexture; }
@ -48,7 +48,8 @@ private:
PtrVector<FrameBuffer> FrameBuffers;
unsigned DepthStencilTexture;
unsigned shadowFBO, shadowColorTex, shadowDepthTex;
unsigned shadowColorTex, shadowDepthTex;
FrameBuffer shadowFBO;
LEAK_CHECK();
};