ec354d9d8cdc47a268ec085cdce6f01498f8bc0a
Linux-VR-Compositor-Dev
Still experimental !
EGL 1.5 is required + 3 extensions :
No OpenGL version requirement, just one extension required :
NOTE :
openglexample from OpenHMD
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h> // must include OpenGL before including the Linux VR Compositor header
#include <lvrc.h>
void main()
{
//
// Initialize OpenHMD device as usual
ohmd_context * ctx = ohmd_ctx_create();
ohmd_device * hmd = ...;
//
// Create instance, the only public object exposed by the API
struct lvrcInstance * compositor = lvrcCreateInstance(hmd);
//
// Initialize your OpenGL context using as usual
// Note that only EGL is supported right now
EGLDisplay display = eglGetDisplay(...);
EGLContext context = eglCreateContext(display, ...);
EGLSurface surface = eglCreateWindowSurface(display, ...);
eglMakeCurrent(display, surface, surface, context);
//
// Initialize HMD rendering
bool bRenderingInit = lvrcInitRenderingEGL(compositor, gl.egl_display, gl.egl_context, gl.egl_surface);
//
// Initialize the Swap Chain (currently 2 textures)
GLuint textures [2];
bool bSwapChainCreated = lvrcInitSwapChain(compositor, width, height, textures);
//
// Main Loop
while (true)
{
ohmd_ctx_update(ctx); // Update OpenHMD as usual
lvrcBeginFrame(compositor);
... // Render to left & right textures as usual
eglSwapBuffers(display, surface); // Swap buffers as usual
lvrcEndFrame(compositor);
}
lvrcReleaseSwapChain(compositor);
// You should destroy your EGL context here
lvrcDestroyInstance(compositor);
ohmd_ctx_destroy(ctx);
}
Description
Languages
C
90.4%
C++
7%
CMake
2.6%