Get current used videocard - xna

I am programming a simulation in xna/monogame; but i want to go sure and wanna warn (myself ..( = ) if I use inadventertly my on-board video card..
Do you know any way to solve my problem?
Does the graphicsdevice offer a property to determine current used video card?
Thank you in advance!

During XNA start-up you can create your own custom GraphicsDeviceManager that can rank or choose devices based on criteria you provide.
MSDN:
GraphicsDeviceManager Class
Handles the configuration and management of the graphics device. Custom behavior of the GraphicsDeviceManager can be achieved by deriving a class from GraphicsDeviceManager. For example, to allow only widescreen devices in full-screen mode the RankDevices method could be overridden to drop non-widescreen devices. - Tell me more...
During the call to your RankDevices() method, you can inspect the list of GraphicsDeviceInformation to determine information about the adapter and device.
RankDevices() orders the provided list so that devices earlier in the list are preferred over devices later in the list. This method can remove devices from the list if they do not satisfy some custom criteria. Tell me more
Each GraphicsDeviceInformation object has an Adapter property of type GraphicsAdapter. There you will find such useful properties as:
Description
DeviceId
DeviceName
VendorId
...and many more.
More
The tutorial Restricting Aspect Ratio on a Graphics Device will walk you through the process of controlling what device you get. Once you understand that, altering it to filter based on device types should be easy.

Related

Getting started on custom gamepad handling

Since I find the default gamepad handling of Windows to be lacking, I'd like to write a custom interface for that purpose. Basically, I want to add a layer between the plugged in gamepads and the Windows gamecontroller management. While I'm not sure how to tackle this problem, these are the steps I was thinking off so far:
Disconnect any plugged in gamepads from Windows' gamecontroller management
Create virtual gamecontroller (perhaps with vJoy/pyvjoy)
Read inputs from the plugged in gamepads and apply them to the virtual gamecontrollers
However, apart from the second bullet point I don't know whether (and how) these are doable. Are there any APIs that can interact with devices the way that I need to? Do I need to get into driver programming and rewrite gamepad drivers?
I know this is a broad question to a very narrow topic, but I'm kind of at a loss where to get started. Any help would be much appreciated.
HIDGuardian covers your first bullet point:
https://github.com/nefarius/ViGEm/tree/master/Sys/HidGuardian
HIDGuardian is used by InputMapper to hide the physical gamepad when a virtual gamepad has been created for the device. This prevents applications from seeing input from the same gamepad twice.

DirectShow filter change property (DSPACK)

I am relatively new to directshow programming, i use a directshow video compression device, using GraphEdit can change the compression settings simply by right clicking on the filter and selecting properties, there a way to do this programmatically?
I tried the VideoMediaType, but i get a single value !? how do I set all the configuration pages?
Configuration http://i.imgur.com/Srpeuyp.png
Pins Interfaces http://i.imgur.com/tlFiJ4j.png
I am programming in Delphi 7 using DSPACK.
These properties are implemented and available though certain device-specific COM interfaces. You need to contact Sigma Designs to request documentation or SDK to access them programmatically. What you are seeing on configuration screenshot is their (Sigma Designs) property page which is internally using the mentioned interfaces to set up the device. To do the same/similar from your code you need interface definitions.

using XInput, is it possible to get an image of the controller?

In my simple mind, it seems useful to ship a nice image of your joystick with an index of the button and axis locations on the image. Can such a thing be queried through the XInput or DirectInput APIs? Would it be driver-specific, and if so which drivers support this?
In particular, I want to support Logitech wheels and XBOX 360 controllers. The Logitech Profiler seems to come with this information (or pull it from the driver). Is it accessible in my code as well?
I see the image of the joystick show up in the game controller properties, but I assume that entire property page is reported from the driver?
XInput does not supply this and it is not supposed to, XInput is an interface for accessing the state of the controller and the capabilities of the controller. This is something that you would detect manually in your code, finding the correct device id and I believe this is what the Logitech Profiler does as well (since it is a custom application for Logitech), it simply has the images as resources in the program itself.
What is commonly done is that you contact Microsoft, Sony, Nintendo or Logitech and they will have high quality images of their controllers that are approved for use in games. Specifically for images of the controller in console games there are certain requirements that you need to follow. The same requirements do not follow for games for windows and other operating systems but you should still be able to retrieve this information from Microsoft and Logitech.
By retrieving the resources yourself you can also convert them to a format that suits the interface where you are presenting them.
Since the Windows XInput API was created specifically for the XBox 360 controller, it's possible to make a great deal of assumptions about the controller layout. Even now, after the release of official drivers for the XBOne gamepad, the official API documents go out of their way to explicitly limit discussion to the 360 pads.

Determine the blackberry processor programmatically?

I want to determine the processor speed of the blackberry device programmatically.
Based on the processor speed i want to display few things on the app.
Please tell me how do i determine this programmatically.
Thanks
There's no way to do that. But you can determine device name and software version and use your own local dictionary with technical specifications of every device model.

Find out which display belongs to which adapter?

I'm working on a SlimDX apps which works for multiple display. The apps will occupy the selected display, and it's selection is input via commandline, as int. I then use System.Windows.Forms.Screen.AllScreens[selection] to find out about the bound, and display my apps "fullscreen" on that display.
Now, to optimize performance, I need to select which gpu adapter to initialize the Direct3D's device. How do I find out which gpu adapter is powering the selected display?
Since Each gpu adapter might have one to two display connected, I can't use the display number.
I'm utilizing Direct3D10. I don't mind solution in Direct3D9.
Worse case would be to let user select display and adapter via commandline, but I prefer a fool prove method.
Thanks
Both D3D10 and D3D11 use DXGI for managing details like this. The Factory interface you create lets you get a list of adapters installed on the system. Each adapter can have one or more outputs, which you can enumerate from the Adapter interface.
This will get you a list of Output interfaces, which have a Description property that contains, among other things, a Rectangle of the output's bounds as well as an IntPtr handle to the monitor on which it is running.
I don't think the Winforms Screen class exposes the underlying native pointer, which is why we provide the SlimDX.Windows.DisplayMonitor class to serve as a replacement for the Screen class. You can use this to determine the particular details of the display and choose the right adapter for your needs.

Resources