public override void Present(float deltaTime) { GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); GL.Enable(EnableCap.Blend); GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); GL.Enable(EnableCap.Texture2D); m_Camera.SetViewport(); // ワールド行列 Matrix4 worldMatrix = Matrix4.Identity; GL.UniformMatrix4(GL.GetUniformLocation(m_ProgramParam.GLProgram.Program, "world"), false, ref worldMatrix); // スプライトの描画 m_SpriteBatcher.BeginBatch(m_Texture); { m_SpriteBatcher.DrawSprite(0, 700, 128.0f, 128.0f, m_RegionUL); } m_SpriteBatcher.EndBatch(); // アニメーションの描画 m_SpriteBatcher.BeginBatch(m_Texture); { TextureRegion keyFrame = m_Animation.GetKeyFrame(m_AnimationSample.m_Time, Animation.ANIMATION_LOOPING); m_SpriteBatcher.DrawSprite(300, 700, 128, 128, keyFrame); //m_SpriteBatcher.DrawSprite(0, 0, 128.0f, 128.0f, m_RegionUL2); } m_SpriteBatcher.EndBatch(); GL.Disable(EnableCap.Blend); }
public override void Present(float deltaTime) { GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); GL.Enable(EnableCap.Blend); GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); GL.Enable(EnableCap.Texture2D); m_Camera.SetViewport(); // ワールド行列 Matrix4 worldMatrix = Matrix4.Identity; GL.UniformMatrix4(GL.GetUniformLocation(m_ProgramParam.GLProgram.Program, "world"), false, ref worldMatrix); // スプライトの描画 m_SpriteBatcher.BeginBatch(m_Texture); { m_SpriteBatcher.DrawSprite(0, 100, 128.0f, 128.0f, m_RegionUL); } m_SpriteBatcher.EndBatch(); //// アニメーションの描画 m_SpriteBatcher.BeginBatch(m_Texture); { TextureRegion keyFrame = m_Animation.GetKeyFrame(m_AnimationSample.m_Time, Animation.ANIMATION_LOOPING); m_SpriteBatcher.DrawSprite(300, 600, 64, 64, keyFrame); //m_SpriteBatcher.DrawSprite(0, 0, 128.0f, 128.0f, m_RegionUL2); } m_SpriteBatcher.EndBatch(); // UIの描画 m_SpriteBatcher.BeginBatch(m_UIAtlas); { Vector2 center = new Vector2(FRUSTRUM_WIDTH / 2.0f, FRUSTRUM_HEIGHT / 2.0f); float width = 256.0f; m_SpriteBatcher.DrawSprite((center.X - (width / 2.0f)), 860, 256.0f, 64.0f, m_RgnButtonBase); m_SpriteBatcher.DrawSprite((center.X - (width / 2.0f)), 860, 256.0f, 64.0f, m_RgnButtonStart); m_SpriteBatcher.DrawSprite((center.X - (width / 2.0f)), 960, 256.0f, 64.0f, m_RgnButtonEnd); } m_SpriteBatcher.EndBatch(); GL.Disable(EnableCap.Blend); }