I'm trying to render my scene to texture. I use the code from the sample "copytex.c" from PSPGL.
I'm creating a texture:
Code: Select all
int render_texture;
glBindTexture(GL_TEXTURE_2D, render_texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_DEBUG_PSP, GL_TRUE);
Code: Select all
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, render_texture);
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, 256,256, 0);
Anyone can help me to solve this?