Questions of rendering to texture

Hello,
I have 2 questions about rendering to texture of OpenGL ES 1.1.

A. I find that the render result on the window surface is incorrect if calling eglBindTexImage after rendering something to the windows surface.
I tested three cases:
Case 1(call it after rendering to texture, the result is OK):
1. Make current(pbuffer)
2. Render to pbuffer
3. Bind pbuffer and texture
4. Make current(window surface)
5. glClear
6. glBindTexture(tex_id)
7. glDrawArrays

8. Release pbuffer from texture

The result is Ok.

Case 2(call it after making the main surface current, the result is OK):
	1. Make current(pbuffer)
	2. Render to pbuffer
	3. Make current(window surface)
	[u]4. Bind pbuffer and texture[/u]
	5. glClear
	6. glBindTexture(tex_id)
	7. glDrawArrays
	...
	8. Release pbuffer from texture
	
Case 3(call it after calling glClear or rendering something and  before rendering to the window surface with the texture maped, the result is incorrect):
	1. Make current(pbuffer)
	2. Render to pbuffer
	3. Make current(window surface)
	[i]4. glClear or render something[/i]
	5. glBindTexture(tex_id)
	[u]6. Bind pbuffer and texture[/u]
	7. glDrawArrays
	...
	8. Release pbuffer from texture

Why the final render result is not correct? Rendering to window surface should not affect the pbuffer surface and binding the pbuffer surface to a texture should not affect the content of the window surface.
What time is the correct time to call eglBindTexImage?

B. Is the eglReleaseTexImage a sync function? After the eglReleaseTexImage returned, has the release operation been done, or just a release command has been sent?

Thank you!
Chris

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.