๐Native Function Reference
Building Bridge Applications
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.
Lifecycle Functions
The lifecycle functions are generally required for a normal native application integration.
initialize_bridge
This function initializes the Bridge thread and allocates required resources.
Parameters
app_name - the C-string name to associate with this application instance
Returns
TRUE if successful, FALSE otherwise
Note: This function must be called prior to any other from the Bridge SDK.
See also
uninitialize_bridge
This function uninitializes the Bridge thread and deallocates required resources.
Returns
always returns TRUE
See also
instance_window_gl
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.
Parameters
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.
Returns
TRUE when a window was created, FALSE otherwise
Note: The window created is meant for use with OpenGL texture sharing
See also
instance_offscreen_window
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.
Parameters
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
Returns
TRUE when a window was created, FALSE otherwise
See also
draw_interop_quilt_texture_gl
Triggers the Looking Glass optical transformation as a rendering post-processing step.
The texture width
and height
values may not be larger than the width and height values returned from get_max_texture_size. This function designates the input texture as the source of quilt views for which the optical transformation will be applied.
Parameters
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
Returns
FALSE for invalid configurations, TRUE otherwise
Utility Functions
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.
get_displays
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
.
Parameters
number_of_indices - the pointer to the returned size of the index array
indices - the pointer to the returned array of display indices
Returns
FALSE if number_of_indices is null, TRUE otherwise
get_bridge_version
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.
Parameters
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
Returns
The semantic version of Bridge with build commit hash
get_display_for_window
Returns the display index used to render the window.
Parameters
wnd - the pointer used to store the platform-specific window handle
display_index - the zero-based index of the display
Returns
TRUE if successful, FALSE otherwise
get_max_texture_size
returns the maximum texture size for rendering to the window
Parameters
wnd - the pointer used to store the platform-specific window handle
size - the pointer to the returned texture size
Returns
the maximum texture size dimension to be used for rendering to the window
See also
show_window
shows or hides the rending window based upon the input flag
Parameters
wnd - the pointer used to store the platform-specific window handle
flag - the toggle to show or hide the window: FALSE=hide, TRUE=show
Returns
FALSE for an invalid window, TRUE otherwise
quiltify_rgbd
Converts an RGBD image into a quilt image using input parameters
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
Returns
TRUE when successful, FALSE otherwise
save_texture_to_file_gl
saves the input OpenGL texture to a file
Parameters
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
Returns
TRUE if successful, FALSE otherwise
See also
save_image_to_file
saves the raw image buffer to a file
Parameters
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
Returns
TRUE if successful, FALSE otherwise
See also
Window Query Functions
The following functions assume that a Looking Glass window was created for a connected Looking Glass display using instance_window_gl. This window is a required input parameter for getting additional device info.
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.
get_window_dimensions
returns with size dimensions of the input window
Parameters
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
Returns
width and height for the input window
See also
get_window_position
returns with position of the input window
Parameters
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
Returns
the x and y coordinates for the input window
See also
get_calibration
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.
Parameters
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
Returns
FALSE for invalid input parameters, TRUE otherwise
See also
get_device_name
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.
Parameters
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
Returns
FALSE if number_of_device_name_wchars is null, TRUE otherwise
See also
get_device_serial
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.
Parameters
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
Returns
FALSE if number_of_serial_wchars is null, TRUE otherwise
See also
get_default_quilt_settings
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.
Parameters
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
Returns
FALSE if number_of_serial_wchars is null, TRUE otherwise
See also
get_default_quilt_settings_for_display
get_device_type
returns the type of display product to render the window
Parameters
wnd - the pointer used to store the platform-specific window handle
hw_enum - the display enum value
Returns
TRUE if successful, FALSE otherwise
See also
get_viewcone
returns the viewcone value for the display product that renders the window
Parameters
wnd - the pointer used to store the platform-specific window handle
viewcone - the pointer to the returned viewcone value
Returns
TRUE if successful, FALSE otherwise
See also
get_invview
returns the inverted views toggle for the given window
Parameters
wnd - the pointer used to store the platform-specific window handle
invview - the pointer to the returned inverted views toggle. 0=FALSE, 1=TRUE
Returns
TRUE if successful, FALSE otherwise
See also
get_ri
returns the red index for the display used with the given window
Parameters
wnd - the pointer used to store the platform-specific window handle
ri - the pointer to the returned red index value (0 or 2)
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_bi
Returns the blue index for the display used with the given window.
Parameters
wnd - the pointer used to store the platform-specific window handle
bi - the pointer to the returned blue index value (0 or 2)
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_tilt
returns the tilt for the display used with the given window
Parameters
wnd - the pointer used to store the platform-specific window handle
tilt - the pointer to the returned tilt value
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_displayaspect
returns the aspect ratio of the display used with the given window
Parameters
wnd - the pointer used to store the platform-specific window handle
displayaspect - the pointer to the returned aspect ratio
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_fringe
returns the fringe value of the display used with the given window
Parameters
wnd - the pointer used to store the platform-specific window handle
fringe - the pointer to the returned fringe value
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_subp
returns the subpixel size of the display used with the given window
Parameters
wnd - the pointer used to store the platform-specific window handle
subp - the pointer to the returned sub pixel size value
Returns
TRUE if successful, FALSE otherwise
get_pitch
returns the pitch of the display used with the given window
Parameters
wnd - the pointer used to store the platform-specific window handle
pitch - the pointer to the returned pitch value
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_center
returns the center of the display used with the given window
Parameters
wnd - the pointer used to store the platform-specific window handle
center - the pointer to the returned center value
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
Display Query Functions
The following functions require a display index parameter which corresponds to an index returned from the get_displays 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.
get_device_name_for_display
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.
Parameters
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
Returns
FALSE if number_of_device_name_wchars is null, TRUE otherwise
See also
get_device_serial_for_display
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.
Parameters
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
Returns
FALSE if number_of_serial_wchars is null, TRUE otherwise
See also
get_dimensions_for_display
returns with size dimensions of the given display index
Parameters
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
Returns
width and height for the input window
See also
get_window_position_for_display
returns with position of the given display index
Parameters
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
Returns
the x and y coordinates for the input window
See also
get_device_type_for_display
returns the type of display product for the given display index
Parameters
display_index - the index for the target Looking Glass display
hw_enum - the display enum value
Returns
TRUE if successful, FALSE otherwise
See also
get_calibration_for_display
returns the calibration values for the given display index
Parameters
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
Returns
FALSE for invalid input parameters, TRUE otherwise
See also
get_invview_for_display
returns the inverted views toggle for the given display index
Parameters
display_index - the index for the target Looking Glass display
invview - the pointer to the returned inverted views toggle. 0=FALSE, 1=TRUE
Returns
TRUE if successful, FALSE otherwise
See also
get_ri_for_display
returns the red index for the display used with the given display index
Parameters
display_index - the index for the target Looking Glass display
ri - the pointer to the returned red index value (0 or 2)
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_bi_for_display
returns the blue index for the display used with the given display index
Parameters
display_index - the index for the target Looking Glass display
bi - the pointer to the returned blue index value (0 or 2)
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_tilt_for_display
returns the tilt for the display used with the given display index
Parameters
display_index - the index for the target Looking Glass display
tilt - the pointer to the returned tilt value
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_displayaspect_for_display
returns the aspect ratio of the display used with the given display index
Parameters
display_index - the index for the target Looking Glass display
displayaspect - the pointer to the returned aspect ratio
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_fringe_for_display
returns the fringe value of the display used with the given display index
Parameters
display_index - the index for the target Looking Glass display
fringe - the pointer to the returned fringe value
Returns
TRUE if successful, FALSE otherwise
Note: this function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_subp_for_display
returns the subpixel size of the display used with the given display index
Parameters
display_index - the index for the target Looking Glass display
subp - the pointer to the returned sub pixel size value
Returns
TRUE if successful, FALSE otherwise
See also
get_viewcone_for_display
returns the viewcone value for the display product with the given display index
Parameters
display_index - the index for the target Looking Glass display
viewcone - the pointer to the returned viewcone value
Returns
TRUE if successful, FALSE otherwise
See also
get_pitch_for_display
returns the pitch of the display used with the given display index
Parameters
display_index - the index for the target Looking Glass display
pitch - the pointer to the returned pitch value
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_center_for_display
returns the center of the display used with the given display index
Parameters
display_index - the index for the target Looking Glass display
center - the pointer to the returned center value
Returns
TRUE if successful, FALSE otherwise
Note: This function is meant only to provide compatibility with HoloPlay Core SDK
See also
get_default_quilt_settings_for_display
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.
Parameters
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
Returns
FALSE if number_of_serial_wchars is null, TRUE otherwise
See also
Last updated