コード例 #1
0
        private void Draw()
        {
            GLES20.Viewport(0, 0, Width, Height);

            GLES20.ClearColor(0f, 0f, 0f, 0f);
            GLES20.Clear(GLES20.GL_COLOR_BUFFER_BIT);

            GLES20.UseProgram(_program);

            _buffer.Position(0);

            GLES20.VertexAttribPointer(0, 3, GLES20.GL_FLOAT, false, 0, _buffer);
            GLES20.EnableVertexAttribArray(0);
            GLES20.DrawArrays(GLES20.GL_TRIANGLES, 0, 3);
        }
コード例 #2
0
        private void glesControl1_OnRender(object sender, EventArgs e)
        {
            GLES20.ClearColor(0f, 0f, 0f, 1f);
            GLES20.Clear(GLES20.GL_COLOR_BUFFER_BIT);

            GLES20.UseProgram(_program);

            _buffer.Position(0);

            GLES20.VertexAttribPointer(0, 3, GLES20.GL_FLOAT, false, 0, _buffer);
            GLES20.EnableVertexAttribArray(0);
            GLES20.DrawArrays(GLES20.GL_TRIANGLES, 0, 3);

            DateTime dt = DateTime.UtcNow;

            if (dt.Subtract(lastFPSIncrease).TotalSeconds >= 1)
            {
                Text            = lastFPSCount.ToString();
                lastFPSIncrease = dt;
                lastFPSCount    = 0;
            }
            lastFPSCount++;
        }