I recently got hired to help write some computer based vision tests and most of the code is being written in VB.Net. I personally think it would be better to write it in c++ but I think that ship has already sailed. Most of the tests are fairly simple graphically for example the depth perception test is just three gray/silver bars on a black background and the middle bar can be made to appear popped in or out using nvidia 3D glasses. The other tests are different but in general involve simple 2d graphics. My understanding is the there is no DirectX support for managed languages after DX9. I know I could use XNA but I would rather not make the end customers have to download the XNA installer. I was thinking about using WPT but my understanding is that WPF is based on vector graphics and that one WPF Pixel is not necessarily a true pixel. I need to have very precise control over the spacing of objects down to the pixel so that the tests are accurate. I guess my question boils down to whether I should use an old version of DX9 a or b, or should I use a DX wrapper like slimDX. The last thought I had was to create a windows application control in c++ and directX for the graphics aspects of each test and then use that control in my vb.net app if that is possible. Any ideas would be welcomed.
2 Answers
UPDATE: The OP has clarified that he wants to use an API that supports NVidia 3D Vision
SlimDX is a C# wrapper for DirectX, and is very complete. In fact - here's a related SO post on using SlimDX for NVidia 3D: Nvidia 3d Video using DirectX11 and SlimDX in C# (if you read the followup, you'll see the poster got it working in DX9)
For the 2D-only portions, WinForms/GDI+ is a good match, however you could also just code the entire thing using SlimDX since you've already got it available.
GDI+: - 2D Graphics API - You can work in C# (closer to your desired C++) and integrate with the legacy VB.Net - Pixel-level control
The only down-side of GDI+ is that it is slow, relative to GPU accelerated 3D libs like DX and OpenGL, but honestly, this will not be noticeable unless you are pushing many megapixels, and have high frame rate requirements.
You are correct that Managed DirectX stopped at DX9 (and is only available for x86 targets).
-
I absolutely must be able to display in 3D because the ability to test stereopsis a must have. I talked with the other programmer who said he was unable to get the video card to recognize the 3D with SlimDX but he might have been doing something wrong. GDI+ does not support 3D does it? – Alexander Van Atta Jul 20 '12 at 00:17
-
Odd, your question specifically says 2D, not 3D. – SSS Jul 20 '12 at 00:23
-
No not 3D as in 3d models, 3D as in stereoscopic display of 2d images like in 3D movies at the theater except we use active shutter glasses synced with the monitor not the passive disposable glasses you get at the movie theater. – Alexander Van Atta Jul 20 '12 at 01:11
-
1Updated my answer based on this. NVidia Developer forums are down, but I'm sure they they have C++/DX sample code (which could be translated to SlimDX). They may also have OpenGL samples (which could be translated to OpenTK). I would probably go with SlimDX for the convenience, but you certainly could have your VB.NET code call a C++/DX DLL if you prefer. – holtavolt Jul 20 '12 at 13:17