How looking-glass/lookingglasscoresdk works
Project Type and Purpose
• The README clearly indicates that this is an SDK designed to enable traditional 3D applications to output holographic imagery to Looking Glass displays. Its role is to provide all necessary window and calibration data (through its API) for proper rendering on these devices.
• The project is split into two main areas: an example project (demonstrating how to integrate with the SDK using OpenGL) and the core SDK components packaged as native dynamic libraries for multiple platforms.
File Structure
• At the top level, you have files such as .gitignore and LICENSE, with two primary subdirectories:
• "ExampleProject": Contains source code (src), shaders, libraries (e.g., glew, glfw, glm) and CMake build configurations. This is a sample implementation illustrating how to use the SDK.
• "HoloPlayCore": Contains multiple dynamic libraries organized by operating system platform (Win32, Win64, linux, macos) along with header files and example C files demonstrating usage.
• This separation suggests a clear architectural design:
• One part is dedicated to the core functionality (providing calibration and window information via the SDK’s API).
• The other part shows a reference implementation on how to integrate and interact with that core functionality (the ExampleProject).
README for Additional Insights
• The README explains how the SDK works – by communicating with Looking Glass Bridge to gather crucial display and calibration information.
• It details prerequisites such as window management, multiple view rendering, and shader application. This indicates that the ExampleProject uses these capabilities to show rendering flow.
a. Main Components:
• SDK Core Library (HoloPlayCore): Illustrate the dynamic libraries divided by platform (Windows, Linux, macOS), and include the API exposed through header files (e.g., HoloPlayCore.h).
• External Service: Show the Looking Glass Bridge service (even though it is not part of the repository, it’s a key runtime component that the core SDK communicates with for window and calibration data).
• Operating System & Graphics Backend: Indicate that the rendering relies on various graphics APIs (OpenGL in the example, but also support for DirectX, Metal, Vulkan is mentioned in the docs).
b. Relationships and Interactions:
• Within the ExampleProject, indicate internal data flows: from shader loading and error checking to generating a borderless fullscreen window.
c. Architectural Patterns and Design Principles:
• Modularity: separate concerns through distinct components (ExampleProject vs. HoloPlayCore).
• Platform abstraction: the dynamic libraries for each OS indicate that the SDK abstracts platform-specific details.
• Point out the dependency inversion: the ExampleProject is decoupled from the intricacies of how calibration data is obtained.
d. Relevant Technologies and Libraries:
• Usage of C++ (source files, CMakeLists) as well as dependencies like GLFW, GLEW, and GLM (found under the ExampleProject’s lib folder).
• Mention the role of shaders (both vertex and fragment shaders under the shader directory) utilized for rendering.
• Reference the dynamic linking approach with separate libraries for each target OS.
• Clear labels for each module: “Example Application (ExampleProject)”, “Core SDK Library (HoloPlayCore)”, “External Service: Looking Glass Bridge”, “Platform & Rendering Backend”.
• The ExampleProject calling into the SDK’s API,
• The SDK querying the external Bridge for calibration and window information,
• Data flowing from the SDK to the ExampleProject for rendering.
• Rectangles for code modules/components,
• Ovals for external services,
• Annotations or legends explaining any platform-specific or graphic API details (for example, OpenGL usage in the example vs. support for other APIs).
• It is important that every key architectural element—from low-level dynamic libraries to high-level application integration—is captured.