1
0
Fork 0

Bug fixes

This commit is contained in:
MrDev023 2017-01-14 20:10:33 +01:00
parent ae3320e067
commit d1ec316066
4 changed files with 82 additions and 75 deletions

View file

@ -41,9 +41,6 @@ public class FrameBufferObject {
//Definir le render Texture
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D, renderedTexture, 0);
IntBuffer drawBuffs = BufferUtils.createIntBuffer(1);
drawBuffs.put(0, GL_COLOR_ATTACHMENT0);
GL20.glDrawBuffers(drawBuffs);
if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
throw new IllegalStateException("FBO not loaded !");
fboTexID = renderedTexture;
@ -75,6 +72,9 @@ public class FrameBufferObject {
public void startRenderToFBO(){
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
IntBuffer drawBuffs = BufferUtils.createIntBuffer(1);
drawBuffs.put(0, GL_COLOR_ATTACHMENT0);
GL20.glDrawBuffers(drawBuffs);
glViewport(0,0,Main.WIDTH,Main.HEIGHT);
}