Render to texture

For offscreen rendering I do the following:

glGenFramebuffersEXT(1, &myFBO);

  1. Bind the framebuffer object
    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, myFBO);

  2. Attach a texture to the FBO
    glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, myTexture, 0);

Question: I saw that texture and buffer must be same size.
But my texture will be scaled. So can I then just do a

SDL_CurrentVideo->glBindTexture( GL_TEXTURE_2D, texture->Id() );
paintInfo->SetOpenGLTextureMode( Alpha(), cForm, xForm.IsScaled(), texture );

even if source texture (unscaled) is smaller than buffer?

andreas

Hi,
according to your post you only attached one texture to your framebuffer. Furthermore you have no renderbuffer attached.
In this case there should be no problem rescaling your texture
that’s attached to the framebuffer, because it’s the only target.

regards,
lobbel

lobbel, thanks!

Now I noticed that glrotated() has no effect? Is this because
not renderbuffer is attached? The texture scaled well.

When I attach a renderbuffer, I get GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS.

What now?

andreas