Results 1 to 3 of 3

Thread: WPF: Tier Explanation

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    WPF: Tier Explanation

    Hello Kiddies!

    Ok today where going to learn about Tiers in WPF. As you may or may not know WPF unloads much of its rendering capabilities to the GPU (video card). Now the issue with this as you are no doubt wondering is some people have old graphic cards and some may have none at all, others have dodgy drivers or the latest ones . This of course poses a problem of how do you know if your pimped to the max application will run on your application users PC!?

    First off don't panic, we have it all under control. You see WPF has different Tiers it uses to gauge how well your GPU can handle rendering of your application. Currently there are three tiers which are:

    Tier 0:
    No video card hardware acceleration / DirectX 7.0 or less

    Tier 1:
    Partial hardware acceleration / Direct 7.1 to 8.x

    Tier 2:
    Full hardware acceleration / DirectX 9.0 and above

    So which is good? Obviously Tier 2 is the best this means you can have full 3D GridView's (which WPF does not yet have..... YET) with transparent cells that have animated values. Tier 1 means it would be wise to lay off a lot of the transparency and moving 3D objects. Tier 0, well you kind of back to winform's really.

    One note I would like to add regarding 3D in WPF, it works fine in vista but on XP, because of some dodgy driver support even though the user may have a great card and be tier 2 anti aliasing can seem a wee bit jaggy.... you've been warned!

    Now the million dollar (or euro) question is how do I tell what tier a user is? Well it just so happens I have this nice little class for you all to use. To remake this class you need to create a WPF Custom Control Library and delete everything from the project then add a new class, copy and paste.

    VB Code:
    1. Public Class TierChecker
    2.     Private Shared RenderingTier As Integer = RenderCapability.Tier >> 16
    3.  
    4.     Public Shared ReadOnly Property GetTier() As Integer
    5.         Get
    6.             Return RenderingTier
    7.         End Get
    8.     End Property
    9.  
    10. End Class

    Small yes, but very handy and its shared so no instantiation. Usage is as follows:

    VB Code:
    1. Dim Tier As Integer = WpfHelper.TierChecker.GetTier
    2.         MessageBox.Show(Tier.ToString)

    This will of course output the Tier value to a messagebox() but it can easily be used for conditional checking to help switch features on or off. (you could even parse different UI's based on which option was picked!!! oh my).

    Any questions post em here

    Toodles,

    DeanMc
    Last edited by DeanMc; Jan 15th, 2009 at 09:18 PM. Reason: Minor Changes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width