[pspgl] Problems with rendering to texture.

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
LarryTM
Posts: 30
Joined: Tue Jul 04, 2006 4:05 am
Contact:

[pspgl] Problems with rendering to texture.

Post by LarryTM »

Hi,

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); 
And try to 'capture' my scene with glCopyTexImage2D:

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);
and all I have is random flickering green texture with some noise or with random parts of other textures i've loaded before.

Anyone can help me to solve this?
LarryTM
Posts: 30
Joined: Tue Jul 04, 2006 4:05 am
Contact:

Post by LarryTM »

anyone?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

You're only posting a TINY piece of the code, and probably not where the error lies. If you want more help, you'll have to post more.
Post Reply