1
Graphics / Re: SFML 2.1 FrameBufferObject alternative with postprocessing shader?
« on: September 15, 2014, 04:01:30 pm »
Hey guys, still here. Wondering if anyone could help me get this mother running.
I was literally typing this when I found out what I was doing wrong. Anyway, I was using Vertex Buffer Objects, some OpenGL functions and stuff, when I found out that window.draw() needs resetGLStates to work correctly after OpenGL calls. So that's what I added, and now it works!
Also, I created the FBO with a depth texture of course!
I was literally typing this when I found out what I was doing wrong. Anyway, I was using Vertex Buffer Objects, some OpenGL functions and stuff, when I found out that window.draw() needs resetGLStates to work correctly after OpenGL calls. So that's what I added, and now it works!
g_FBO.setActive(); // Have to do this or it complains about the VBOs
IdleGL(); // Idle function of GL
DisplayGL(); // Render function
g_Window->resetGLStates(); // Reset GL states
g_Window->draw(sf::Sprite(g_FBO.getTexture())); // Draw texture as sprite.
g_Window->display(); // Display window
IdleGL(); // Idle function of GL
DisplayGL(); // Render function
g_Window->resetGLStates(); // Reset GL states
g_Window->draw(sf::Sprite(g_FBO.getTexture())); // Draw texture as sprite.
g_Window->display(); // Display window
Also, I created the FBO with a depth texture of course!