1

I would normally post this on nvidia's developer forums but they are still offline from last months hacking. If anyone knows of another good community for these types of questions I would love to know about them.

I am developing some software designed to test human vision. Right now I have two tests written one that presents a stereoscopic image using nvidia's 3D vision v.2 glasses and another test that displays letters on the screen similar to the charts you see in an eye doctors exam room. My problem is the during the "chart test" the 3D vision is getting triggered and causing the screen to look dim. I can enable and disable the 3D vision through the nvidia control panel between running the different tests but that is a less then elegant solution. I am using DX9 and Visual Basic to develop my code. In order to trigger the 3D in the Stereoscopic test I am using the NV_STEREO_IMAGE_SIGNATURE Method that is described here. Basically the method involves making a backbuffer that is twice the width of the screen plus an extra column of pixel data in the middle where you insert a special signature that tells the video card that it is a stereo image and the left half of the backbuffer should be displayed to the left eye and the right half to the right eye. I don't do any of that in my code for the "Chart test" but the 3d Vision is still getting triggered and I can't figure out why. Is there a way to tell the video card to temporally disable the 3d Vision functionality in the code?

Thanks

Community
  • 1
  • 1
Alexander Van Atta
  • 870
  • 11
  • 34

1 Answers1

1

I think I may have found the solution to my own question. Nvidia supplies a library called NVAPI that can be statically loaded and and contains calls such as NVAPI_STEREO_ENABLE , and NVAPI_STEREO_DISABLE. Downloads and info on the NVAPI can be found here. I will edit this post with an example of the actual code when I have completed the solution.

EDIT: Because C# / Visual Basic do not allow static loading of .lib files I had to create a Visual C++ to wrap the NVAPI.lib file. After referencing the lib file and adding the include header files to my wrapper project I wrote the following code.

#include "stdafx.h"
#include "nvapi.h"

public ref class NvApiWrapper
{   
public: 
    static bool NvApiWrapper_Initialize(){
    if (NvAPI_Initialize() == 0){
        return true;
    } else {
        return false;
    }
    }

    static bool NvApiWrapper_Stereo_Enable(){
    if (NvAPI_Stereo_Enable() == 0){
        return true;
    } else {
        return false;
    }
    }

    static bool NvApiWrapper_Stereo_Disable(){
    if (NvAPI_Stereo_Disable() == 0){
        return true;
    } else {
        return false;
    }
    }
};

I was only interested in those two stereo methods so I did not add anything else but there are lots of interesting methods that can be called. You must call NvAPI_Initialize() before any other calls.

Alexander Van Atta
  • 870
  • 11
  • 34