OpenGL, direct mode, plugin -- possible?
I thought this would be relatively easy, but the more I read (here in the forums, elsewhere in the web) the more it looks like what I need to do is not possible.
tl;dr:
Is there any way for an OVR-based library loaded at run-time within an existing app to share OpenGL resources with the app in direct mode?
Long version:
I develop plugins for Max/MSP/Jitter, which is a widely-used visual creative coding platform in media art. (The same issue will apply to other platforms too). It is cross-platform and OpenGL-based. Plugins are loaded as dynamic libraries. I developed a plugin to support the oculus (http://github.com/grrrwaaa/max_oculus) which works great in extended mode/client-based rendering on a powerful enough rig. I'm sure performance would be better in direct mode, so I'd like to use this app to render GL content into a texture, and send that texture to the plugin to forward to the (direct mode) rift, for SDK rendering.
But the more I read, the more it seems like this won't be possible because of weird stuff that the SDK does to the OpenGL driver in ovr_Initialize(). Because it is a plugin, the exe has already loaded and started doing things like wglext stuff and creating windows/contexts before the library can call ovr_Initialize(). I can't force the app to link to libovr. Is what I want to do even possible? Is there e.g. a way using shared contexts to bridge between app-rendered texture and libovr SDK rendering?
It seems pretty drastic not to be able to use the SDK from a loaded library...
tl;dr:
Is there any way for an OVR-based library loaded at run-time within an existing app to share OpenGL resources with the app in direct mode?
Long version:
I develop plugins for Max/MSP/Jitter, which is a widely-used visual creative coding platform in media art. (The same issue will apply to other platforms too). It is cross-platform and OpenGL-based. Plugins are loaded as dynamic libraries. I developed a plugin to support the oculus (http://github.com/grrrwaaa/max_oculus) which works great in extended mode/client-based rendering on a powerful enough rig. I'm sure performance would be better in direct mode, so I'd like to use this app to render GL content into a texture, and send that texture to the plugin to forward to the (direct mode) rift, for SDK rendering.
But the more I read, the more it seems like this won't be possible because of weird stuff that the SDK does to the OpenGL driver in ovr_Initialize(). Because it is a plugin, the exe has already loaded and started doing things like wglext stuff and creating windows/contexts before the library can call ovr_Initialize(). I can't force the app to link to libovr. Is what I want to do even possible? Is there e.g. a way using shared contexts to bridge between app-rendered texture and libovr SDK rendering?
It seems pretty drastic not to be able to use the SDK from a loaded library...
