Skip to content

Instantly share code, notes, and snippets.

@ChristophHaag
ChristophHaag / overlay.cpp
Created Jul 13, 2020
openvr sdl opengl overlay example
View overlay.cpp
// g++ overlay.cpp -o overlay $(pkg-config --cflags --libs gl sdl2) -lopenvr_api
#define GL_GLEXT_PROTOTYPES 1
#define GL3_PROTOTYPES 1
#include <GL/gl.h>
#include <iostream>
#include <SDL2/SDL.h>
#include <openvr/openvr.h>
@ChristophHaag
ChristophHaag / actions.cpp
Last active Mar 20, 2020
openvr actions test snippet
View actions.cpp
// g++ actions.cpp -o actions -lopenvr_api
#include <openvr/openvr.h>
#include <stdio.h>
#include <chrono>
#include <thread>
bool showTrigger = false;
bool showActionSet = true;
@ChristophHaag
ChristophHaag / actions.json
Created Nov 8, 2019
openvr overlay, dashboard pointer, actions
View actions.json
{
"default_bindings":[
{
"controller_type":"vive_controller",
"binding_url":"bindings_vive_controller.json"
},
{
"controller_type": "knuckles",
"binding_url": "bindings_vive_controller.json"
}
@ChristophHaag
ChristophHaag / actions.cpp
Created Sep 25, 2019
ShowActionOrigins and ShowBindingsForActionSet test
View actions.cpp
// g++ actions.cpp -o actions -lopenvr_api
#include <openvr/openvr.h>
#include <stdio.h>
#include <chrono>
#include <thread>
bool showTrigger = false;
bool showActionSet = true;
@ChristophHaag
ChristophHaag / actions.cpp
Created Aug 22, 2019
minimal example for bChanged issue since SteamVR 1.7.7
View actions.cpp
// g++ actions.cpp -o actions -lopenvr_api
#include <stdio.h>
#include <openvr/openvr.h>
#include <chrono>
#include <thread>
using namespace vr;
@ChristophHaag
ChristophHaag / actions.cpp
Last active Aug 22, 2019
print right trigger button bState and bChanged
View actions.cpp
// g++ actions.cpp -o actions -lopenvr_api
#include <stdio.h>
#include <openvr/openvr.h>
#include <chrono>
#include <thread>
using namespace vr;
View 0001-Add-constructor-to-GLTexture-using-GL_EXT_memory_obj.patch
From 5b369d50098db47eace62e76d86ac22f09d2f506 Mon Sep 17 00:00:00 2001
From: Christoph Haag <christoph.haag@collabora.com>
Date: Mon, 19 Aug 2019 17:31:11 +0200
Subject: [PATCH] Add constructor to GLTexture using GL_EXT_memory_object
Instead of allocating memory for the texture with OpenGL, import the memory from an FD.
---
libkwineffects/kwingltexture.cpp | 31 +++++++++++++++++++++++++++++++
libkwineffects/kwingltexture.h | 1 +
2 files changed, 32 insertions(+)
View 0001-Make-it-possible-to-create-an-uninitialized-GLTextur.patch
From 060728102335dbdd5541a34fec5e70f0d9122b13 Mon Sep 17 00:00:00 2001
From: Christoph Haag <christoph.haag@collabora.com>
Date: Mon, 19 Aug 2019 16:54:02 +0200
Subject: [PATCH] Make it possible to create an uninitialized GLTexture
This can be useful if the caller wants to use already existing texture memory.
For example, memory might be imported with GL_EXT_memory_object.
---
libkwineffects/kwingltexture.cpp | 20 +++++++++++++-------
libkwineffects/kwingltexture.h | 2 +-
View vive_config.json
{
"acc_bias": [
0.1572,
-0.01115,
-0.1449
],
"acc_scale": [
0.9997,
0.9989,
0.998
View openhmd_test.diff
diff --git a/src/openhmd.c b/src/openhmd.c
index e500be5..727d67a 100644
--- a/src/openhmd.c
+++ b/src/openhmd.c
@@ -289,7 +289,7 @@ static int ohmd_device_getf_unp(ohmd_device* device, ohmd_float_value type, floa
mat4x4f orient, world_shift, result;
omat4x4f_init_look_at(&orient, &rot, &point);
omat4x4f_init_translate(&world_shift, -device->position.x +(device->properties.ipd / 2.0f), -device->position.y, -device->position.z);
- omat4x4f_mult(&orient, &world_shift, &result);
+ omat4x4f_mult(&world_shift, &orient, &result);