Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Draw pixel data taken from the backbuffer back to itself?
    primarykey
    data
    text
    <p>I'm working on a mobile application for Symbian 5th edition using <strong>OpenGLES</strong>.<br> This application is a pretty standard 2D app, and I make no use of the DepthBuffer.</p> <p>I need to grab a snapshot of the display and then draw the very same snapshot back to the backbuffer.</p> <p>I'm using <code>glReadPixels((GLint)0, (GLint)0, (GLint)nWidth-1, (GLint)nHeight-1, GL_RGB, GL_UNSIGNED_BYTE, m_pPixelData) </code></p> <p>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..)</p> <p>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.</p> <p>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..)</p> <p>The display size is 480x640 and here is the code I want to use in order to draw the rect:</p> <pre><code> glEnable(GL_TEXTURE_2D); //displayTex is my texture built out of the pixel data glBindTexture(GL_TEXTURE_2D, m_pESSharedData-&gt;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(); </code></pre> <p>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. :)</p> <p>I thank you for your time.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload