How to Draw pixel data taken from the backbuffer back to itself?

I'm working on a mobile application for Symbian 5th edition using OpenGLES.
This application is a pretty standard 2D app, and I make no use of the DepthBuffer.

I need to grab a snapshot of the display and then draw the very same snapshot back to the backbuffer.

I'm using glReadPixels((GLint)0, (GLint)0, (GLint)nWidth-1, (GLint)nHeight-1, GL_RGB, GL_UNSIGNED_BYTE, m_pPixelData)

in order to get the pixel data I need, but I'm rather new to OpenGLES and I don't know how to draw the data back to the backbuffer. (in OpenGL its easy using DrawPixels..)

I've read that I should generate a texture from the data, so I did. But now I'm not sure how to draw this texture.

Do I need to draw it as a texture of a Rectangular element ? if so than how am I suppose to define this rect ? ( the coordinates just doesn't make sense to me..)

The display size is 480x640 and here is the code I want to use in order to draw the rect:

    glEnable(GL_TEXTURE_2D);
    //displayTex is my texture built out of the pixel data
    glBindTexture(GL_TEXTURE_2D, m_pESSharedData->displayTex);

    //Bottom
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

    glBegin(GL_QUADS);
    glTexCoord2f(0.0f, 0.0f);
    glVertex3f(-2.5f, -2.5f, 2.5f);
    glTexCoord2f(1.0f, 0.0f);
    glVertex3f(2.5f, -2.5f, 2.5f);
    glTexCoord2f(1.0f, 1.0f);
    glVertex3f(2.5f, -2.5f, -2.5f);
    glTexCoord2f(0.0f, 1.0f);
    glVertex3f(-2.5f, -2.5f, -2.5f);

    glEnd();

Note that above code is something I've picked up along the way, and I think this is the outline of what I'm suppose to do. feel free to take me off this track. :)

I thank you for your time.

13.10.2009 17:59:56
I'll walk you through it if you're still checking on your question. I don't know enough about your platform to help with that, but I can help you with OpenGL. How familiar are you with coordinate systems (like projection, modelview, etc)?
GManNickG 13.10.2009 22:06:57
Hey GMan and 10q for you reply, I've read a few tutorials and I've came across projection, modelview etc.. So i know the basics of it. Can you help with the definitions of this rect/binding a texture to it, under OpenGL ES ?
Ita 15.10.2009 14:09:58
1 ОТВЕТ
РЕШЕНИЕ

You first need to make sure that the version of OpenGL-ES on Series60 5th edition can handle textures whose height and width aren't powers of 2.

I would advise forum nokia for that kind of query.

Shameless plug:

Quick Recipes On Symbian OS contains a whole chapter explaining the basics of OpenGL-ES on Symbian OS. The 3D code samples are here.

1
14.10.2009 14:25:11
surfaces with power of 2 width/height was the missing link. Thanks.
Ita 9.12.2010 12:30:42