Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference error: window is not defined #30

Open
grrrwaaa opened this issue Oct 10, 2024 · 3 comments
Open

Reference error: window is not defined #30

grrrwaaa opened this issue Oct 10, 2024 · 3 comments

Comments

@grrrwaaa
Copy link

I created a new Node.js project and inserted the example code as per README:

import {BridgeClient} from '@lookingglass/bridge'

const Bridge = BridgeClient.getInstance()

async function run() {
    await Bridge.connect()
    console.log("ok")
}
run()

Result:

ReferenceError: window is not defined
    at ct (C:\Users\alice\Documents\anode_lookingglass\node_modules\@lookingglass\bridge\dist\looking-glass-bridge.js:1:2962)
    at dt.connectToBridgeEventSource (C:\Users\alice\Documents\anode_lookingglass\node_modules\@lookingglass\bridge\dist\looking-glass-bridge.js:1:4627)
    at T.subscribeToEvents (C:\Users\alice\Documents\anode_lookingglass\node_modules\@lookingglass\bridge\dist\looking-glass-bridge.js:1:80823)
    at T.connect (C:\Users\alice\Documents\anode_lookingglass\node_modules\@lookingglass\bridge\dist\looking-glass-bridge.js:1:71163) 
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async run (file:///C:/Users/alice/Documents/anode_lookingglass/test.mjs:12:5)

Node.js v20.18.0

Is this module only designed to work in a browser context?

I have another Node.js project that generates OpenGL scenes directly and want to view them on the Looking Glass. I am able to create a fullscreen undecorated window in my Node.js script and I can see this on the Looking Glass. I assumed that I needed to use Bridge to get the appropriate calibration data for the shaders to create the quilt. Is this possible via the '@lookingglass/bridge' node module?

@BryanChrisBrown
Copy link
Contributor

Can you try this PR here? #21

Definitely curious to learn more about your project that runs OpenGL directly, we've got a lower level bridge api using shared textures that might be exciting to try there!

@grrrwaaa
Copy link
Author

Will definitely try when I get back to the lab next week, tha k you!

And yes, if there's a shared texture workflow possible that would probably be even better! Is that documented somewhere yet?

Thanks!

@BryanChrisBrown
Copy link
Contributor

@grrrwaaa The Bridge SDK documentation is available here: https://docs.lookingglassfactory.com/core/looking-glass-bridge-sdk

let me know if you get a chance to try the PR or if you hit any other issues with the SDK itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants