System.IComparable.CompareTo(GroupKey)

Here are the examples of the csharp api System.IComparable.CompareTo(GroupKey) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

19 Source : Batch.cs
with GNU General Public License v3.0
from askeladdk

int IComparable<InstanceKey>.CompareTo(InstanceKey other)
			{
				var x = this.key.CompareTo(other.key);
				return x != 0 ? x : this.index - other.index;
			}

19 Source : Batch.cs
with GNU General Public License v3.0
from askeladdk

protected override int Submit(Instance[] instances, int count)
		{
			Array.Sort(keys, instances, 0, count);

			var ncalls = 0;

			var i = 0;
			while(i < count)
			{
				// find the range of the group.
				var k = keys[i].key;
				var j = i;
				while(j < count && k.CompareTo(keys[j].key) == 0)
					j++;

				var range = j - i;

				// copy the range to the gpu.
				VBO.Update(instances, i, 0, range);

				// submit the render call
				Submit(k, range);
				ncalls++;

				i = j;
			}

			return ncalls;
		}