示例#1
0
        private void glesControl1_OnCreate()
        {
            _program = LoadProgram(@"
				attribute vec4 vPosition;
				void main()            
				{                          
					gl_Position = vPosition;
				}
			"            , @"
				precision mediump float; 
				void main()
				{
					gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
				}
			"            );

            float[] vertices =
            {
                0.0f,   0.5f, 0.0f,
                -0.5f, -0.5f, 0.0f,
                0.5f,  -0.5f, 0.0f
            };

            _buffer = new GLBuffer <float>(vertices.Length);

            _buffer.Put(vertices);
        }
示例#2
0
        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            _display = new EGLDisplay(Handle);

            _program = LoadProgram(@"
				attribute vec4 vPosition;
				void main()            
				{                          
					gl_Position = vPosition;
				}
			"            , @"
				precision mediump float; 
				void main()
				{
					gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
				}
			"            );

            float[] vertices =
            {
                0.0f,   0.5f, 0.0f,
                -0.5f, -0.5f, 0.0f,
                0.5f,  -0.5f, 0.0f
            };

            _buffer = new GLBuffer <float>(vertices.Length);

            _buffer.Put(vertices);
        }