My favorites | Sign in
Project Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Squared.Game {
public class PerfHUDDeviceManager : GraphicsDeviceManager {
public PerfHUDDeviceManager (Microsoft.Xna.Framework.Game game)
: base(game) {
}

protected override void RankDevices (List<GraphicsDeviceInformation> foundDevices) {
base.RankDevices(foundDevices);

bool foundPerfHud = false;

foreach (var device in foundDevices) {
if (device.Adapter.Description.Contains("PerfHUD")) {
foundPerfHud = true;
break;
}
}

if (foundPerfHud) {
var temp = foundDevices.OrderBy(
(gdi) => !(gdi.Adapter.Description.Contains("PerfHUD"))
).ToArray();

foundDevices.Clear();
foundDevices.AddRange(temp);

foreach (var dev in foundDevices)
dev.DeviceType = DeviceType.Reference;
}
}
}
}
Show details Hide details

Change log

r277 by kevin.gadd on Jul 04, 2009   Diff
Performance tuning for BufferPool
Tweaks to PerfHUDDeviceManager
Go to: 
Project members, sign in to write a code review

Older revisions

r274 by kevin.gadd on Jul 01, 2009   Diff
Handle cases where an animation sets a
new active animation while it's
running
Add Bounds.FromIntersection,
Bounds.Expand, Bounds.Translate and
...
All revisions of this file

File info

Size: 1176 bytes, 37 lines
Hosted by Google Code