Posts

Showing posts with the label xna

C# / XNA - Error - XNA Framework HiDef Profile

When creating an XNA game, and the application produces the following error, your video card does not support the current version of DirectX. In this case, the requirement is video card support for pixel shader 4.0 . No suitable graphics card found. Could not find a Direct3D device that supports the XNA Framework HiDef profile. Verify that a suitable graphics device is installed. Make sure the desktop is not locked, and that no other application is running in full screen mode. Avoid running under Remote Desktop or as a Windows service. Check the display properties to make sure hardware acceleration is set to Full. If your video card does not support pixel shader 4.0 , you can toggle the game profile, from HiDef to Reach . To modify this, go to project properties , XNA Game Studio , and toggle the radio button, Use Reach to access a limited API set supported by Windows Phone, Xbox 360, and Windows.

C# / XNA - Device Enumeration

Graphics cards support a variety of resolutions, refresh rates, and aspect ratios. In order to determine which display modes are available. The following function generates these display modes, and enters them into a List of type DisplayMode . List dmList = new List (); public void GetDeviceEnumeration() { foreach (DisplayMode dm in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes) dmList.Add(dm); } Once the List of DisplayMode s is obtained, simply iterate through the available display modes, and populate some sort of user interface control, such as a listbox, combobox, etc, allowing users to select which resolution they want to use. The following options can be accessed through the DisplayMode: Width, Height, AspectRatio, and Format. Width: Available Screen Width. Height: Available Screen Height. Format: Available Surface Format. (Commonly used: COLOR , and BRG565 .) Aspect Ratio: Common Aspect Ratios below, Regular and Widescreen. Widescreen ...