๐Ÿ”ŒIntegrating Native Applications

Bring support for the Looking Glass display to your application

Overview

Integrating with the Bridge SDK consists of five steps:

  1. Configure a shared GPU rendering context

  2. Initialize Bridge to spawn a post-processing thread and allocate resources

  3. Create a Looking Glass window using the shared rendering context

  4. Render views of a 3D scene into a framebuffer object

  5. Trigger the Bridge post-processing step with the framebuffer object

This method of integration works for all Looking Glass displays. It is supported on Windows and MacOS using OpenGL. It is supported on Windows using DirectX 11 and 12. It is supported on MacOS using Metal. This method will apply a special transformation function that will map each diode on the Looking Glass display to the correct color corresponding to the direction of light emitted from the diode. This was previously the responsibility of the developer using HoloPlay Core. This example will demonstrate the aforementioned steps using OpenGL.

Configure a Shared GPU Rendering Context

The first step is to configure a GPU rendering context. This example code uses GLFW with GLAD:

// initialize glfw
if (!glfwInit()) return -1;

// create preview window
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
GLFWwindow* window = glfwCreateWindow(800, 800, "Bridge SDK example", nullptr, nullptr);

if (!window) {
	glfwTerminate();
	return -1;
}
glfwMakeContextCurrent(window);

Initialize Bridge

The second step is to initialize Bridge. This step is required before calling any other Bridge functions.

Create a Looking Glass window

The third step is to create a window that can be used to render to a Looking Glass display.

Render Views of a 3D Scene

The fourth step is to render a 3D scene into a framebuffer object using a quilt layout.

Trigger the Bridge Post-Processing

The fifth and last step consists of trigger the post-processing shader pipeline necessary to apply the Looking Glass optical transformation.

Note: Upon termination the application should also call uninitialize_bridge when deallocating any other resources used by the program.

Last updated

Was this helpful?