0
如何实现几个使用opengl的场景之间的转换?OpenGL ES 2.0几个场景
我有2个不同的场景。每个创建它的框架并渲染缓冲区并绑定它。但后来我尝试在这些场景之间切换 - 没有任何反应......我试图在打开时删除所有缓冲区,但它不起作用。第一个场景仍然可见..
如何实现几个使用opengl的场景之间的转换?OpenGL ES 2.0几个场景
我有2个不同的场景。每个创建它的框架并渲染缓冲区并绑定它。但后来我尝试在这些场景之间切换 - 没有任何反应......我试图在打开时删除所有缓冲区,但它不起作用。第一个场景仍然可见..
那么,根据我的经验,您可能需要处理第一场景视觉效果的纹理。 一个快速的想法是使用psm工作室的OpenGLES方法。
public TitleScene()
{
this.Camera.SetViewFromViewport();
_texture = new Texture2D("Application/images/title.png",false);
_ti = new TextureInfo(_texture);
SpriteUV titleScreen = new SpriteUV(_ti);
titleScreen.Scale = _ti.TextureSizef;
titleScreen.Pivot = new Vector2(0.5f,0.5f);
titleScreen.Position = new Vector2(Director.Instance.GL.Context.GetViewport().Width/2,
Director.Instance.GL.Context.GetViewport().Height/2);
this.AddChild(titleScreen);
public override void Update (float dt)
{
base.Update (dt);
var touches = Touch.GetData(0).ToArray();
if((touches.Length >0 && touches[0].Status == TouchStatus.Down) || Input2.GamePad0.Cross.Press)
{
Director.Instance.ReplaceScene(new MenuScene());
}
}
~TitleScene()
{
_texture.Dispose();
_ti.Dispose();
}
}
我希望这会给你一些你缺少的帮助。