Open topic with navigation

# Display Basics

You do not need to explicitly provide information about the displays to the zSpace Core SDK. The zsInitialize() function detects the connected displays for you. However, the SDK provides functions to retrieve information about these displays.

The following is a partial list of the functions in the Display API.

zsGetNumDisplaysByType()
  Gets the number of displays of a given type. For the zSpace display, use ZS_DISPLAY_TYPE_ZSPACE for the ZSDisplayType.
zsFindDisplayByType()
  Gets the display handle for a display of a given type. This function requires the display's index number. Assuming there is only one display of that type, the index will be 0.
zsGetDisplayPosition()
  Gets the pixel location of the specified display on the virtual desktop. The x,y coordinates refer to the display's upper left corner.
zsGetDisplaySize()
  Gets the width and height of the specified display in meters.
zsGetDisplayNativeResolution()
  Gets the display's preferred native resolution in pixels.
zsGetDisplayAngle()
  Gets the angle of the display in degrees for the x, y, and z axes.

The following is a brief code example of how to query the zSpace display's position. Error handling is omitted for brevity.

      ZSContext zSpaceContext = NULL;
      zsInitialize(&zSpaceContext);

      // Grab a handle to the first zSpace display if it exists.
      ZSHandle displayHandle = NULL;
      zsFindDisplayByType(zSpaceContext, ZS_DISPLAY_TYPE_ZSPACE, 0, &displayHandle);

      // Get the display's position (top-left corner) in pixels.
      ZSInt32 x = 0;
      ZSInt32 y = 0;
      zsGetDisplayPosition(displayHandle, &x, &y);

As a reminder, using the Display API is not required in order to set up stereo, head tracking, or device tracking.

Open topic with navigation