Native Function Reference
Last updated
Was this helpful?
Last updated
Was this helpful?
The easiest way to build an application using the new Bridge SDK is to link against the headers and dynamic libraries included in the Bridge installation. Bridge installs header files and libraries alongside the driver executable. The default install locations are listed below for Bridge version 2.4.10.
MacOS
Headers: /Applications/Looking Glass Bridge 2.4.10.app/Contents/runtime
Libraries: /Applications/Looking Glass Bridge 2.4.10.app/Contents/MacOS
Windows
Headers: C:\Program Files\Looking Glass\Looking Glass Bridge 2.4.10\runtime
Libraries: C:\Program Files\Looking Glass\Looking Glass Bridge 2.4.10
Update your project build settings to use a compiler include directive for the headers and a library search path for the libraries. The libraries may be safely copied into a project and distributed with an application as well.
The bridge.h
header exposes C functions and a C++ wrapper class to access Bridge SDK functionality. The C++ wrapper is even capable of searching for the Bridge dynamic libraries installed on host computers. The native function reference below is a complete list of functions in the SDK.
The lifecycle functions are generally required for a normal .
This function initializes the Bridge thread and allocates required resources.
app_name - the C-string name to associate with this application instance
TRUE if successful, FALSE otherwise
Note: This function must be called prior to any other from the Bridge SDK.
This function uninitializes the Bridge thread and deallocates required resources.
always returns TRUE
Creates a new window using display parameters.
If the display_index
parameter is not supplied, the Bridge SDK will search for the first display that matches a Looking Glass product and use that. The window position and size will match the selected display.
wnd - the pointer used to store the platform-specific window handle
display_index - the optional index of the display to configure the window for. A value of -1
will select the first available Looking Glass display.
TRUE when a window was created, FALSE otherwise
Creates a new window using the input parameters.
The window width
and height
will match in the input parameters. The calibration parameters will be loaded from the input calibration_path
parameter. This function is meant for automated rendering and does not require a display.
wnd - the pointer used to store the platform-specific window handle
width - the desired width of the new window
height - the desired height of the new window
calibration_path - the filesystem path for a Looking Glass calibration file
TRUE when a window was created, FALSE otherwise
Triggers the Looking Glass optical transformation as a rendering post-processing step.
wnd - the pointer used to store the platform-specific window handle
texture - the texture handle to be shared between rendering contexts
format - the pixel format of the supplied texture
width - the width of the supplied texture
height - the height of the supplied texture
vx - the horizontal count of quilt views (columns) rendered to the texture
vy - the vertical count of quilt views (rows) rendered to the texture
aspect - the aspect ratio of the views
zoom - the optional zoom to be applied
FALSE for invalid configurations, TRUE otherwise
The utility functions are useful for handling operations like converting an RGBD asset to a Quilt asset or saving framebuffer textures to files for debugging purposes.
Returns the display indices attached to the host.
The caller is responsible for allocating the array of index values To get the array size, this function should be called twice. When called with the indices
parameter set to nullptr
, it will return the size of the indices array. When called with the indices
parameter set to an array pointer, the display indices will be copied into the supplied array up to a limit supplied by number_of_indices
.
number_of_indices - the pointer to the returned size of the index array
indices - the pointer to the returned array of display indices
FALSE if number_of_indices is null, TRUE otherwise
This function queries the Bridge SDK to get the version number.
The caller is responsible for allocating the postfix C-string buffer. To get the buffer size, this function should be called twice. When called with the postfix
parameter set to nullptr, it will return the size of the postfix string.
When called with the postfix
parameter set to a buffer pointer, the build hash postfix will be copied into the supplied buffer up to the length of characters specified in the number_of_postfix_wchars
parameter.
major - the pointer to the returned numeral representing the major version
minor - the pointer to the returned numeral representing the minor version
build - the pointer to the returned numeral representing the build (or patch) version
number_of_postfix_wchars - the pointer to the length of characters in the version postfix string
postfix - the pointer to the version postfix string
The semantic version of Bridge with build commit hash
Returns the display index used to render the window.
wnd - the pointer used to store the platform-specific window handle
display_index - the zero-based index of the display
TRUE if successful, FALSE otherwise
returns the maximum texture size for rendering to the window
wnd - the pointer used to store the platform-specific window handle
size - the pointer to the returned texture size
the maximum texture size dimension to be used for rendering to the window
shows or hides the rending window based upon the input flag
wnd - the pointer used to store the platform-specific window handle
flag - the toggle to show or hide the window: FALSE=hide, TRUE=show
FALSE for an invalid window, TRUE otherwise
Converts an RGBD image into a quilt image using input parameters
wnd - the pointer used to store the platform-specific window handle
columns - the desired output quilt columns
rows - the desired output quilt rows
views - the desired total number of views
aspect - the aspect ratio of the resulting quilt
zoom - the zoom applied to the RGBD input
cam_dist - the camera distance applied during RGBD rendering
fov - the field of view applied during RGBD rendering
crop_pos_x - the x coordinate offset applied during RGBD rendering
crop_pos_y - the y coordinate offset applied during RGBD rendering
depth_inversion - a toggle to invert the depth map: 0=FALSE, 1=TRUE
chroma_depth - a toggle to interpret the depth map using a full color spectrum: 0=FALSE, 1=TRUE
depth_loc - the location of the depth map within the image: 0=top, 1=bottom, 2=right, 3=left
depthiness - the amount of z-scaling applied to the RGBD input
depth_cutoff - a z-depth threshold value applied to the RGBD input
focus - the z-depth value representing the focal plane of the resulting quilt
input_path - the local filesystem path to the input RGBD image
output_path - the local filesystem path for the desired output quilt image
TRUE when successful, FALSE otherwise
saves the input OpenGL texture to a file
wnd - the pointer used to store the platform-specific window handle
filename - the filesystem path for the saved image
texture - the texture handle to be saved to disk
format - the pixel format of the supplied texture
width - the width of the supplied texture
height - the height of the supplied texture
TRUE if successful, FALSE otherwise
saves the raw image buffer to a file
wnd - the pointer used to store the platform-specific window handle
filename - the filesystem path for the saved image
image - the raw image buffer to be saved
format - the pixel format of the supplied image
width - the width of the supplied image
height - the height of the supplied image
TRUE if successful, FALSE otherwise
The legacy Looking Glass Core SDK assumed that only a single Looking Glass device would be used. If multiple devices are connected to a computer then it was quite difficult to render to them both simultaneously. The new Bridge SDK provides support for developers using multiple Looking Glass displays and for easily exporting images rendered using 3rd party engines.
returns with size dimensions of the input window
wnd - the pointer used to store the platform-specific window handle
width - the pointer to the returned width value
height - the pointer to the returned height value
width and height for the input window
returns with position of the input window
wnd - the pointer used to store the platform-specific window handle
x - the pointer to the returned x coordinate value
y - the pointer to the returned y coordinate value
the x and y coordinates for the input window
Returns the calibration values for the given window.
The calibration parameters assocaited with the input window will be returned as parameter values. If the cells
pointer is null, it will be ignored. Any other parameters with null values will be considered invalid.
wnd - the pointer used to store the platform-specific window handle
center - the pointer to the returned center value
pitch - the pointer to the returned pitch value
slope - the pointer to the returned slope value
width - the pointer to the returned width value
height - the pointer to the returned height value
dpi - the pointer to the returned DPI value
flip_x - the pointer to the returned horizontal flip toggle. 0=FALSE, 1=TRUE
invView - the pointer to the returned inverted views toggle. 0=FALSE, 1=TRUE
viewcone - the pointer to the returned viewcone value
fringe - the pointer to the returned fringe value
cell_pattern_mode - the pointer to the returned cell pattern mode
number_of_cells - the pointer to the returned cell count
cells - the pointer to the returned cell pattern struct
FALSE for invalid input parameters, TRUE otherwise
Returns the device name for the given window.
The caller is responsible for allocating the device_name
C-string buffer. To get the buffer size, this function should be called twice. When called with the device_name
parameter set to nullptr
, it will return the size of the device_name
string.
When called with the device_name
parameter set to a buffer pointer, the device name will be copied into the supplied buffer up to the length of characters specified in the number_of_device_name_wchars
parameter.
The size of the buffer is returned as a count of wide string characters. In practice, wchar is 32 bits on Linux and MacOS but 16 bits on Windows.
wnd - the pointer used to store the platform-specific window handle
number_of_device_name_wchars - the pointer to the returned size of the C-string buffer
device_name - the pointer to the returned size device name C-string buffer
FALSE if number_of_device_name_wchars is null, TRUE otherwise
Returns the device serial number for the given window.
The caller is responsible for allocating the serial number C-string buffer. To get the buffer size, this function should be called twice. When called with the serial
parameter set to nullptr, it will return the size of the serial string.
When called with the serial
parameter set to a buffer pointer, the device serial will be copied into the supplied buffer up to the length of characters specified in the number_of_serial_wchars
parameter.
The size of the buffer is returned as a count of wide string characters. In practice, wchar is 32 bits on Linux and MacOS but 16 bits on Windows.
wnd - the pointer used to store the platform-specific window handle
number_of_serial_wchars - the pointer to the returned size of the C-string buffer
serial - the pointer to the returned size device serial C-string buffer
FALSE if number_of_serial_wchars is null, TRUE otherwise
Returns the ideal quilt settings for the given window. The ideal quilt settings are aset of heuristics defined by Looking Glass for each display product.
wnd - the pointer used to store the platform-specific window handle
aspect - the pointer to the returned aspect value
quilt_width - the pointer to the returned width value
quilt_height - the pointer to the returned height value
quilt_columns - the pointer to the returned quilt columns value
quilt_rows - the pointer to the returned quilt rows value
FALSE if number_of_serial_wchars is null, TRUE otherwise
returns the type of display product to render the window
wnd - the pointer used to store the platform-specific window handle
hw_enum - the display enum value
TRUE if successful, FALSE otherwise
returns the viewcone value for the display product that renders the window
wnd - the pointer used to store the platform-specific window handle
viewcone - the pointer to the returned viewcone value
TRUE if successful, FALSE otherwise
returns the inverted views toggle for the given window
wnd - the pointer used to store the platform-specific window handle
invview - the pointer to the returned inverted views toggle. 0=FALSE, 1=TRUE
TRUE if successful, FALSE otherwise
returns the red index for the display used with the given window
wnd - the pointer used to store the platform-specific window handle
ri - the pointer to the returned red index value (0 or 2)
TRUE if successful, FALSE otherwise
Returns the blue index for the display used with the given window.
wnd - the pointer used to store the platform-specific window handle
bi - the pointer to the returned blue index value (0 or 2)
TRUE if successful, FALSE otherwise
returns the tilt for the display used with the given window
wnd - the pointer used to store the platform-specific window handle
tilt - the pointer to the returned tilt value
TRUE if successful, FALSE otherwise
returns the aspect ratio of the display used with the given window
wnd - the pointer used to store the platform-specific window handle
displayaspect - the pointer to the returned aspect ratio
TRUE if successful, FALSE otherwise
returns the fringe value of the display used with the given window
wnd - the pointer used to store the platform-specific window handle
fringe - the pointer to the returned fringe value
TRUE if successful, FALSE otherwise
returns the subpixel size of the display used with the given window
wnd - the pointer used to store the platform-specific window handle
subp - the pointer to the returned sub pixel size value
TRUE if successful, FALSE otherwise
returns the pitch of the display used with the given window
wnd - the pointer used to store the platform-specific window handle
pitch - the pointer to the returned pitch value
TRUE if successful, FALSE otherwise
returns the center of the display used with the given window
wnd - the pointer used to store the platform-specific window handle
center - the pointer to the returned center value
TRUE if successful, FALSE otherwise
Returns the device name for the given display index.
The caller is responsible for allocating the device_name
C-string buffer. To get the buffer size, this function should be called twice. When called with the device_name
parameter set to nullptr
, it will return the size of the device_name
string.
When called with the device_name
parameter set to a buffer pointer, the device name will be copied into the supplied buffer up to the length of characters specified in the number_of_device_name_wchars
parameter.
The size of the buffer is returned as a count of wide string characters. In practice, wchar is 32 bits on Linux and MacOS but 16 bits on Windows.
display_index - the index for the target Looking Glass display
number_of_device_name_wchars - the pointer to the returned size of the C-string buffer
device_name - the pointer to the returned size device name C-string buffer
FALSE if number_of_device_name_wchars is null, TRUE otherwise
Returns the device serial number for the given display index.
The caller is responsible for allocating the serial number C-string buffer. To get the buffer size, this function should be called twice. When called with the serial
parameter set to nullptr, it will return the size of the serial string.
When called with the serial
parameter set to a buffer pointer, the device serial will be copied into the supplied buffer up to the length of characters specified in the number_of_serial_wchars
parameter.
The size of the buffer is returned as a count of wide string characters. In practice, wchar is 32 bits on Linux and MacOS but 16 bits on Windows.
display_index - the index for the target Looking Glass display
number_of_serial_wchars - the pointer to the returned size of the C-string buffer
serial - the pointer to the returned size device serial C-string buffer
FALSE if number_of_serial_wchars is null, TRUE otherwise
returns with size dimensions of the given display index
display_index - the index for the target Looking Glass display
width - the pointer to the returned width value
height - the pointer to the returned height value
width and height for the input window
returns with position of the given display index
display_index - the index for the target Looking Glass display
x - the pointer to the returned x coordinate value
y - the pointer to the returned y coordinate value
the x and y coordinates for the input window
returns the type of display product for the given display index
display_index - the index for the target Looking Glass display
hw_enum - the display enum value
TRUE if successful, FALSE otherwise
returns the calibration values for the given display index
display_index - the index for the target Looking Glass display
center - the pointer to the returned center value
pitch - the pointer to the returned pitch value
slope - the pointer to the returned slope value
width - the pointer to the returned width value
height - the pointer to the returned height value
dpi - the pointer to the returned DPI value
flip_x - the pointer to the returned horizontal flip toggle. 0=FALSE, 1=TRUE
invView - the pointer to the returned inverted views toggle. 0=FALSE, 1=TRUE
viewcone - the pointer to the returned viewcone value
fringe - the pointer to the returned fringe value
cell_pattern_mode - the pointer to the returned cell pattern mode
number_of_cells - the pointer to the returned cell count
cells - the pointer to the returned cell pattern struct
FALSE for invalid input parameters, TRUE otherwise
returns the inverted views toggle for the given display index
display_index - the index for the target Looking Glass display
invview - the pointer to the returned inverted views toggle. 0=FALSE, 1=TRUE
TRUE if successful, FALSE otherwise
returns the red index for the display used with the given display index
display_index - the index for the target Looking Glass display
ri - the pointer to the returned red index value (0 or 2)
TRUE if successful, FALSE otherwise
returns the blue index for the display used with the given display index
display_index - the index for the target Looking Glass display
bi - the pointer to the returned blue index value (0 or 2)
TRUE if successful, FALSE otherwise
returns the tilt for the display used with the given display index
display_index - the index for the target Looking Glass display
tilt - the pointer to the returned tilt value
TRUE if successful, FALSE otherwise
returns the aspect ratio of the display used with the given display index
display_index - the index for the target Looking Glass display
displayaspect - the pointer to the returned aspect ratio
TRUE if successful, FALSE otherwise
returns the fringe value of the display used with the given display index
display_index - the index for the target Looking Glass display
fringe - the pointer to the returned fringe value
TRUE if successful, FALSE otherwise
returns the subpixel size of the display used with the given display index
display_index - the index for the target Looking Glass display
subp - the pointer to the returned sub pixel size value
TRUE if successful, FALSE otherwise
returns the viewcone value for the display product with the given display index
display_index - the index for the target Looking Glass display
viewcone - the pointer to the returned viewcone value
TRUE if successful, FALSE otherwise
returns the pitch of the display used with the given display index
display_index - the index for the target Looking Glass display
pitch - the pointer to the returned pitch value
TRUE if successful, FALSE otherwise
returns the center of the display used with the given display index
display_index - the index for the target Looking Glass display
center - the pointer to the returned center value
TRUE if successful, FALSE otherwise
Returns the ideal quilt settings for the given display index. The ideal quilt settings are aset of heuristics defined by Looking Glass for each display product.
display_index - the index for the target Looking Glass display
aspect - the pointer to the returned aspect value
quilt_width - the pointer to the returned width value
quilt_height - the pointer to the returned height value
quilt_columns - the pointer to the returned quilt columns value
quilt_rows - the pointer to the returned quilt rows value
FALSE if number_of_serial_wchars is null, TRUE otherwise
The texture width
and height
values may not be larger than the width and height values returned from . This function designates the input texture as the source of quilt views for which the optical transformation will be applied.
The following functions assume that a Looking Glass window was created for a connected Looking Glass display using . This window is a required input parameter for getting additional device info.
The following functions require a display index parameter which corresponds to an index returned from the function. These functions may be called before any window is created to allow a developer to select a specific Looking Glass device if multiple devices are connected.