Пример #1
0
        public void SetValue(Vector2[] value)
        {
            GL.UseProgram(_parentEffect.CurrentTechnique.Passes [0].shaderProgram);
            // We have to convert the Vector array to a float array to pass the values
//			float[] va = new float[value.Length * 2];
//			int pos = 0;
//			for (int x = 0; x < value.Length; x++) {
//				va[pos] = value[x].X;
//				va[pos] = value[x].Y;
//				pos += 2;
//			}
            //GL.Uniform2 (internalIndex, elements.Count, va);
            //_cachedValue = vect2;
            //CPUValues.Length, ref CPUValues[0].X

            MonoMac.OpenGL.Vector2[] vect2 = new MonoMac.OpenGL.Vector2[value.Length];
            for (int x = 0; x < value.Length; x++)
            {
                vect2 [x] = new MonoMac.OpenGL.Vector2(value [x].X, value [x].Y);
            }
            //GL.Uniform2 (internalIndex, vect2.Length, ref vect2[0].X);

            for (int i = 0; i < value.Length; i++)
            {
                GL.Uniform2(internalIndex + i, vect2 [i].X, vect2 [i].Y);
            }


            GL.UseProgram(0);
        }
Пример #2
0
 public void SetValue(Vector2 value)
 {
     GL.UseProgram(_parentEffect.CurrentTechnique.Passes [0].shaderProgram);
     MonoMac.OpenGL.Vector2 vect2 = new MonoMac.OpenGL.Vector2(value.X, value.Y);
     _cachedValue = vect2;
     GL.Uniform2(internalIndex, vect2);
     GL.UseProgram(0);
 }
Пример #3
0
		public void SetValue (Vector2 value)
		{
			GL.UseProgram(_parentEffect.CurrentTechnique.Passes[0].shaderProgram);			
			MonoMac.OpenGL.Vector2 vect2 = new MonoMac.OpenGL.Vector2(value.X, value.Y);
			_cachedValue = vect2;
			GL.Uniform2(internalIndex,vect2);
			GL.UseProgram(0);
		}
Пример #4
0
using System;