views:

159

answers:

1

Hi,

I have a little trouble switching OpenGLES views(EAGLViews). When i add an subview to EAGLView, texture that is shown in the view dissapear. I don't know why. I'm using code from tutorials for loading textures.

I have a view, there I'm displaying texture, then I add subview to this view by calling addSubview method. And then, when I want to return to the previous view I simply call removeFromSuperview method on the subview. And problem is, that in the superview there is not texture anymore. Don't you know what I'm doing wrong?

I don't want to post all the code here, it is template from XCode and as i said, texture loading is taken from tutorials on the internet.

Maybe if you don't know why this is happening, at least, please gimme and advice on switching EAGLViews. (if there's better way then addSubview and then removeFromSuperview).

Thanks a lot.

+1  A: 

Are you calling + (BOOL)setCurrentContext:(EAGLContext *)context; on the context of each view before drawing?

Rhythmic Fistman
yes, but I've already solve it another way, I'm adding all views as subviews of main window and it's working fine now, and it's good enough for me, even if it is not good at all :) but thank you for reply :)
Jenicek