Getting Started
This page takes you from a clean Windows PC to a rotating cube streamed into QAROS by a source app you built yourself. The app is the Vulkan cube example; your own source app works the same way.
| Step | You | Takes |
|---|---|---|
| 1 | install QAROS, accept the administrator prompt once | a few minutes |
| 2 | clone this repository | seconds |
| 3 | build the cube | several minutes the first time |
| 4 | run it; it asks QAROS to join, with no code | seconds |
| 5 | click Allow in QAROS, once | seconds |
| 6 | see the cube on the Visualizer or a headset | |
| 7 | run it again: no prompt | seconds |
What you need
| PC | Windows 10 or 11, x64, NVIDIA GPU (see System Requirements) |
| Rights | an administrator account, once, to install QAROS |
| Tools | Visual Studio 2022 Build Tools with "Desktop development with C++" and its recommended components (they include CMake and Ninja), Git. No Vulkan SDK: the build fetches the Vulkan headers, loader and shader compiler itself. |
Install the tools from a PowerShell prompt, if you do not have them yet:
winget install --id Microsoft.VisualStudio.2022.BuildTools -e --override "--passive --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"
winget install --id Kitware.CMake -e
winget install --id Git.Git -e
1. Install QAROS
- Run
QAROS-Setup-<version>.exe(orQAROS-Demo-Setup-<version>.exefor the demo) and accept the Windows administrator prompt. QAROS installs for all users of the PC, intoC:\Program Files\Quaternar\QAROS.- Preview builds: SmartScreen may show "Windows protected your PC". Choose More info, then Run anyway (Installation).
- When the setup finishes, QAROS is running: its icon is in the notification area of the taskbar. If it is not, start QAROS from the Start menu.
Details (what is installed, firewall, upgrade, uninstall): Installation.
2. Get this repository
git clone https://github.com/Quaternar/qaros.git
cd qaros
You need no other download: the C API header is in the repository, and every app loads the QAROS runtime you just installed.
3. Build the cube
Open Developer PowerShell for VS 2022 from the Start menu, go to the qaros folder and run:
cmake --preset x64-windows -DBUILD_VULKAN_EXAMPLE=ON -DVCPKG_MANIFEST_FEATURES=examples-vulkan
cmake --build --preset x64-windows-release --target qar-vulkan-source
The first configure downloads vcpkg and builds the Vulkan dependencies, which takes several minutes. Later builds are fast.
4. Run it
.\build\x64-windows\qar-streaming-c\examples\vulkan_cube\Release\qar-vulkan-source.exe
The console shows Joining the QAROS on this PC..., then Waiting for approval in QAROS hub. The cube joins with the app tag vulkan-cube.examples.qaros, so QAROS knows it again on every start (App tags).
5. Allow it
QAROS asks "Allow qar-vulkan-source to join QAROS?" in a window in front of all other windows. An open Visualizer asks the same question; answer either. The window shows what Windows reports about the app: publisher ("Unknown publisher", your build is not signed), executable, path and signature. Click Allow within 120 seconds. Deny is the default, and Allow stays greyed out for one second after the window opens. Then Allow takes a mouse click; in the QAROS window it also takes an accessibility Invoke (Narrator, NVDA, UI Automation). No key ever presses it. Closing the window denies. Any program running as your Windows user can also press Allow in the QAROS window once it is enabled, even while the window is covered.
The console shows Joined QAROS as peer <id>, names the GPU (Rendering on ...), then shows Connected. Waiting for rendering targets.
6. See it
- On this PC: the Visualizer opens when QAROS starts; if you closed it, left-click the QAROS tray icon. The console shows
Rendering for target ..., and the cube streams into its own app volume, 1.5 m in front of the room origin. - On a headset: install the QAROS player on the device (Player Installation) and pair it once from the Visualizer: over USB, with a QR code or by the code the headset shows (Pair a Headset). Every viewer gets its own camera of the cube.
Stop the cube with Ctrl+C.
The cube renders 60 times a second for every viewer that can take a frame. --fps <n> changes the rate, --uncapped renders as fast as the viewers take frames, and --render-loop request-driven renders each frame for the viewer's request instead (Render Loops).
7. Run it again
Run the same command again. The cube joins without a prompt, under the same peer id as before (the same Joined QAROS as peer line), so the Visualizer and every headset see the same app, not a new one. QAROS remembers the approval for this exact file: as long as you neither rebuild nor move it, no one is asked again, also after restarting the PC or updating QAROS.
To remove QAROS, see Installation: Uninstall.
If something goes wrong
The cube prints what happened and what to do. The common cases:
| The cube says | Do this |
|---|---|
Could not load QAROS. Install QAROS on this machine, then start this app again. | install QAROS (step 1) |
Could not start or reach QAROS on this machine. Start QAROS from the Start menu, then start this app again. | the cube starts QAROS when it does not run, and QAROS did not start: start QAROS from the Start menu, then run the cube again |
Nobody answered the approval prompt in QAROS in time... | run the cube again, then click Allow |
QAROS did not allow this app to join... | someone clicked Deny: run the cube again. The Details: line names any other reason, such as QAROS running for another Windows user |
The program answering on this machine is not the installed QAROS... | reinstall QAROS from the official setup; the cube does not retry |
This app no longer matches what QAROS approved... | you moved or copied the executable: revoke its approval (Source Applications) and run it again |
More: Troubleshooting.
:::note Rebuilding The cube is not code-signed, so QAROS approves this exact file. After every rebuild QAROS asks again. A code-signed app keeps its approval across updates: see Onboarding and Sessions. :::
Your own source app
QAROS ships a native C API, a C#/.NET binding over it and a Rust binding over it. Pick your language above; the selection follows you across the whole Developer Guide. Every app has the same shape: initialize the library, create a runtime, obtain a session, do work, tear down in reverse. For the mental model read Concepts.
On the Hub machine, your application joins as a local app. The join starts the Hub when it does not run, and the Hub keeps running after your app exits. On another machine, your application pairs with a code and the Hub's host and port (Onboarding and Sessions). QAROS must be installed on the machine your app runs on; see Installation.
The C SDK is:
qar_streaming.h: one generated header with the complete v0 C API, inqar-streaming-c/include/of this repository. Never edit it.qar-streaming-c.dll: the runtime library, from the QAROS installed on the PC. Your app ships no copy of it.- Examples: small programs in
qar-streaming-c/examples/, compiled by this repository's build so they always match the header. The Tutorials are built from them.
Load the installed runtime
Define QAR_ENABLE_DYNAMIC_LOADING, put QAR_IMPLEMENT_DYNAMIC_LOADING() in one source file and call qar_library_load(NULL) before any other API call. It looks beside your executable, then at the runtime of the QAROS instance QAR_INSTANCE names (every QAROS hub sets it for the apps it starts, the Visualizer's included: default for the installed QAROS, its own instance for a development hub; you set it only for an app you start by hand), then loads the installed QAROS (HKLM\SOFTWARE\Quaternar\QAROS, value InstallFolder, <InstallFolder>\bin\qar-streaming-c.dll), then searches PATH (the full lookup). Do not ship qar-streaming-c.dll beside your app: that copy would win over the installed one. With no runtime found it prints where it looked and returns false, so your app keeps working without AR/VR. Your app does no searching of its own. Leave QarRuntimeInit::runtime_binaries_folder_path empty: it defaults to the folder the library came from.
#define QAR_ENABLE_DYNAMIC_LOADING
#include <qar_streaming.h>
QAR_IMPLEMENT_DYNAMIC_LOADING() // exactly once per application
int main(int argc, char** argv)
{
if (!qar_library_load(NULL)) // the installed QAROS
{
// QAROS not installed: run without AR/VR features
return 1;
}
// ... use the API ...
qar_library_unload();
return 0;
}
Functions are loaded by symbol name into tables your application owns, so newer runtimes keep working with older applications, and an application built against a newer header keeps working with an older runtime: a function that runtime lacks returns QAR_STATUS_NOT_IMPLEMENTED. Never pin the header or compare versions; see Compatibility. Linking the import library also works, but then the whole runtime bin/ has to sit next to your executable. Walkthrough: Dynamic Loading tutorial.
Build the other examples
cmake --preset x64-windows
cmake --build --preset x64-windows-debug
# No argument: the default lookup finds the installed QAROS (or the runtime of the
# instance QAR_INSTANCE names); the other examples load it the same way
.\build\x64-windows\qar-streaming-c\examples\Debug\dynamic_loading.exe
# --qaros-library=PATH loads that qar-streaming-c.dll instead
.\build\x64-windows\qar-streaming-c\examples\Debug\dynamic_loading.exe --qaros-library=C:\path\to\qar-streaming-c.dll
The program skeleton
Library init, runtime, session, work, teardown in reverse.
#define QAR_ENABLE_DYNAMIC_LOADING
#include <qar_streaming.h>
QAR_IMPLEMENT_DYNAMIC_LOADING()
int main(void)
{
// 0. Load the installed runtime
if (!qar_library_load(NULL))
return 1;
// 1. Library init (process-wide, once)
QarLibraryInit lib_init = qar_library_init_default();
lib_init.enable_console_logging = true;
qar_result_log_if_error(qar_library_init(&lib_init));
// 2. Runtime create (your process's QAROS context)
QarRuntimeInit rt_init = qar_runtime_init_default();
QarRuntime* runtime = NULL;
qar_result_log_if_error(qar_runtime_create(&rt_init, &runtime));
// 3. Obtain a session: on the QAROS PC, join as a local app
// (see Onboarding and Sessions)
// 4. Do work: app volume, render streams, panels
// 5. Teardown, in reverse
qar_runtime_handle_destroy(runtime);
qar_result_log_if_error(qar_library_destroy());
qar_library_unload();
return 0;
}
Next: read API Conventions once (the API follows a handful of strict patterns), then Onboarding and Sessions for step 3 and Rendering Streams for step 4.