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
38
39
40
41
42
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Squared.Game {
public class PerfHUDDeviceManager : GraphicsDeviceManager {
public bool PerfHUDActive = false;

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;

}

PerfHUDActive = foundPerfHud;
}
}
}
Show details Hide details

Change log

r281 by kevin.gadd on Jul 18, 2009   Diff
[No log message]
Go to: 
Project members, sign in to write a code review

Older revisions

r277 by kevin.gadd on Jul 04, 2009   Diff
Performance tuning for BufferPool
Tweaks to PerfHUDDeviceManager
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: 1269 bytes, 42 lines
Hosted by Google Code