I'm so confused with the ogl rtt things. The tutorials I can find don't really explain how which is the one that renders the scene to a texture. I don't even know if my texture is valid or not.
So , which is the key code that really renders the texture.
assuming a empty texture is created by this:
m_fboTexture = pGraphics->CreateTexture2D(800,600,false);
then generate fbo
glGenFramebuffers(1,&m_fbo);
glBindFramebuffer(GL_FRAMEBUFFER,m_fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D,m_fboTexture,0);
then how can i draw to it in my render loop?
It's such a confusing stuff :(