Skip to content

How to Use

The HoloPlay API is available for Windows in the form of a .dll and Mac OS as a .bundle file. It can be loaded as a shared library in any environment that is possible. In C/C++, you can use the holoplay.h header file to easily set the appropriate function pointers.

This guide assumes the user is developing an application for use with the Looking Glass and has knowledge of how to load a shared library.

General Usage

  1. Load the HoloPlay API. For example, in Python, the call would look like this: holoplay = ctypes.CDLL("HoloPlayAPI"); For C/C++ environments, you can use the holoplay.h header file. Instructions on how to use it are at the bottom of the page

  2. Call hp_initialize() to set up API values and load calibration

  3. Generate a quilt. There are multiple possibilities for doing this:

    • Rendering 3D geometry: Set up your virtual camera to take multiple renders. For each view, render to a framebuffer and call hp_copyViewToQuilt() to copy the view to the quilt

    • Loading individual views from existing data: For each view, load the image data into a glTexture, bind the glTexture, and call hp_copyViewToQuilt()

    • Loading a quilt from existing data: First, set the quilt settings to match the incoming quilt's settings using hp_setupQuiltSettings() or hp_setupCustomQuiltSettings(). Then bind the hp_quiltTexture and load the image data into it

  4. Call hp_drawLightfield() to draw the final light field image to the Looking Glass

Using holoplay.h in C/C++

The holoplay.h header can be included to add function pointers for HoloPlay API calls. To use it, first you must define HP_LOAD_LIBRARY, then call hp_loadLibrary(), like such:

#define HP_LOAD_LIBRARY // tells the header to create function pointers
#include <holoplay.h> // include holoplay header

int main()
    hp_loadLibrary(); // loads the library and gets the sets up the function pointers
    hp_initialize(); // loads the config and initializes the OpenGL variables