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();
}
}
我希望這會給你一些你缺少的幫助。