2018-10-09 19:57:58 +02:00
2018-09-19 13:20:43 +02:00
2018-10-09 19:57:58 +02:00
2018-09-23 19:47:40 +02:00
2018-10-09 19:56:49 +02:00
2018-09-18 19:54:03 +02:00
2018-09-19 13:27:12 +02:00
2018-09-23 17:37:43 +02:00

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
No description provided
Readme 135 KiB
Languages
C 90.4%
C++ 7%
CMake 2.6%