Пример #1
0
        public override void Resume()
        {
            DebugLogViewer.WriteLine("Resume");

            GL.ClearColor(0.7f, 0.83f, 0.86f, 1f);

            // ライトを設定
            float   lightAngle = 45.0f;
            Vector3 lightDir   = new Vector3((float)Math.Cos((float)lightAngle), -1.0f, (float)Math.Sin((float)lightAngle));

            lightDir.Normalize();
            GL.Uniform3(GL.GetUniformLocation(m_ProgramParam.GLProgram.Program, "lightDirection"), lightDir);

#if false
            // カメラを設定
            m_Camera.CreateViewportMatrix();
            Matrix4 viewProjectionMatrix = m_Camera.ViewProjectionMatrix;
            GL.UniformMatrix4(GL.GetUniformLocation(m_ProgramParam.GLProgram.Program, "viewProjection"),
                              false, ref viewProjectionMatrix);
#else
            //// カメラを設定
            //m_Camera.CreateViewportMatrix();
            //Matrix4 viewProjectionMatrix = m_Camera.ViewProjectionMatrix;
            //GL.UniformMatrix4(GL.GetUniformLocation(m_ProgramParam.GLProgram.Program, "viewProjection"),
            //false, ref viewProjectionMatrix);
#endif

            m_Texture  = new Texture(m_Game, "Images/AnimationSample.png");
            m_RegionUL = new TextureRegion(m_Texture, 0, 0, 64, 64);


            m_TextureAnimation = new Texture(m_Game, "Images/AnimationSample.png");
            m_Animation        = new Animation(0.2f, new TextureRegion[]
            {
                new TextureRegion(m_TextureAnimation, 0, 0, 64, 64),
                new TextureRegion(m_TextureAnimation, 64, 0, 64, 64),
                new TextureRegion(m_TextureAnimation, 128, 0, 64, 64),
                new TextureRegion(m_TextureAnimation, 192, 0, 64, 64),
            });

            m_UIAtlas        = new Texture(m_Game, "Images/ui_sample.png");
            m_RgnButtonBase  = new TextureRegion(m_UIAtlas, 0, 0, 128, 32);
            m_RgnButtonStart = new TextureRegion(m_UIAtlas, 128, 0, 128, 32);
            m_RgnButtonEnd   = new TextureRegion(m_UIAtlas, 128, 32, 128, 32);


            Vector2 center = new Vector2(FRUSTRUM_WIDTH / 2.0f, FRUSTRUM_HEIGHT / 2.0f);
            float   width  = 256.0f;
            m_RectButtonStart = new CGRect((center.X - (width / 2.0f)), 860, 256.0f, 64.0f);
            m_RectButtonEnd   = new CGRect((center.X - (width / 2.0f)), 960, 256.0f, 64.0f);
        }
Пример #2
0
        public override void Resume()
        {
            DebugLogViewer.WriteLine("Resume");

            GL.ClearColor(0.7f, 0.83f, 0.86f, 1f);

            // ライトを設定
            float   lightAngle = 45.0f;
            Vector3 lightDir   = new Vector3((float)Math.Cos((float)lightAngle), -1.0f, (float)Math.Sin((float)lightAngle));

            lightDir.Normalize();
            GL.Uniform3(GL.GetUniformLocation(m_ProgramParam.GLProgram.Program, "lightDirection"), lightDir);

            // カメラを設定
            m_Camera.CreateViewportMatrix();
            Matrix4 viewProjectionMatrix = m_Camera.ViewProjectionMatrix;

            GL.UniformMatrix4(GL.GetUniformLocation(m_ProgramParam.GLProgram.Program, "viewProjection"),
                              false, ref viewProjectionMatrix);

            m_Texture  = new Texture(m_Game, "Images/AnimationSample.png");
            m_RegionUL = new TextureRegion(m_Texture, 0, 0, 64, 64);


            m_TextureAnimation = new Texture(m_Game, "Images/AnimationSample.png");
            m_Animation        = new Animation(0.2f, new TextureRegion[]
            {
                new TextureRegion(m_TextureAnimation, 0, 0, 64, 64),
                new TextureRegion(m_TextureAnimation, 64, 0, 64, 64),
                new TextureRegion(m_TextureAnimation, 128, 0, 64, 64),
                new TextureRegion(m_TextureAnimation, 192, 0, 64, 64),
            });
        }