2018-09-19 13:20:43 +02:00
2018-09-19 13:20:43 +02:00
2018-09-19 13:20:43 +02:00
2018-09-18 20:02:43 +02:00
2018-09-18 22:09:15 +02:00
2018-09-18 19:54:03 +02:00
2018-09-19 13:20:43 +02:00
2018-09-18 20:18:10 +02:00

Linux-VR-Compositor-Dev

This is preview release ! (WIP)


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 Linux VR Compositor SwapChain
  bool bSwapChainCreated = lvrcInitSwapChain(compositor);

  //
  // Initialize OpenGL using EGL
  // This is mostly as usual, the only change is that you must use the provided NativeDisplay/NativeWindow
  EGLDisplay display = eglGetDisplay(lvrcSwapChainGetNativeDisplay(compositor));
  EGLContext context = eglCreateContext(display, ...);
  EGLSurface surface = eglCreateWindowSurface(display, lvrcSwapChainGetNativeWindow(compositor), ...);
  
  eglMakeCurrent(display, surface, surface, >context);
  
  //
  // The compositor needs to create some resources that will be used during frame composition
  // NOTE : the EGL context MUST be bound when calling this function
  bool bCompositorInit = lvrcInitFrameResources(compositor);
  
  //
  // Main Loop
  while (true)
  {
    ohmd_ctx_update(ctx); // Update OpenHMD as usual
    
    lvrcBeginFrame(compositor);
  
    ... // Render to left & right textures as usual
    
    lvrcSubmitFrameLeft(compositor, left_texture);
    
    lvrcSubmitFrameRight(compositor, right_texture);

    eglSwapBuffers(display, surface); // Swap buffers as usual
    
    lvrcEndFrame(compositor);
  }

  lvrcReleaseFrameResources(compositor);

  // You should destroy your EGL context here
  
  lvrcReleaseSwapChain(compositor);

  lvrcDestroyInstance(compositor);
  
  ohmd_ctx_destroy(ctx);
}
Description
No description provided
Readme 135 KiB
Languages
C 90.4%
C++ 7%
CMake 2.6%