1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-03 04:53:35 +00:00

Fix headset types;

This commit is contained in:
bjorn 2017-01-26 02:26:15 -08:00
parent e80f390151
commit 1714804651
2 changed files with 3 additions and 4 deletions

View file

@ -3,8 +3,6 @@
#pragma once #pragma once
typedef void (*headsetRenderCallback)(int eyeIndex, void* userdata);
typedef enum { typedef enum {
EYE_LEFT, EYE_LEFT,
EYE_RIGHT EYE_RIGHT
@ -34,6 +32,7 @@ typedef struct {
} Controller; } Controller;
typedef vec_t(Controller*) vec_controller_t; typedef vec_t(Controller*) vec_controller_t;
typedef void (*headsetRenderCallback)(HeadsetEye eye, void* userdata);
typedef struct { typedef struct {
void (*destroy)(void* headset); void (*destroy)(void* headset);

View file

@ -499,7 +499,7 @@ void viveRenderTo(void* headset, headsetRenderCallback callback, void* userdata)
mat4_multiply(transform, head); mat4_multiply(transform, head);
// Projection // Projection
matrix = vive->system->GetProjectionMatrix(eye, vive->clipNear, vive->clipFar).m; matrix = vive->system->GetProjectionMatrix(vrEye, vive->clipNear, vive->clipFar).m;
mat4_fromMat44(projection, matrix); mat4_fromMat44(projection, matrix);
// Render // Render
@ -518,7 +518,7 @@ void viveRenderTo(void* headset, headsetRenderCallback callback, void* userdata)
ETextureType textureType = ETextureType_TextureType_OpenGL; ETextureType textureType = ETextureType_TextureType_OpenGL;
Texture_t eyeTexture = { (void*) texture, textureType, EColorSpace_ColorSpace_Gamma }; Texture_t eyeTexture = { (void*) texture, textureType, EColorSpace_ColorSpace_Gamma };
EVRSubmitFlags flags = EVRSubmitFlags_Submit_Default; EVRSubmitFlags flags = EVRSubmitFlags_Submit_Default;
vive->compositor->Submit(eye, &eyeTexture, NULL, flags); vive->compositor->Submit(vrEye, &eyeTexture, NULL, flags);
} }
vive->isRendering = 0; vive->isRendering = 0;