aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormwturvey <michael.w.turvey@intel.com>2017-03-15 11:38:22 -0700
committermwturvey <michael.w.turvey@intel.com>2017-03-15 11:38:22 -0700
commit1caa844dad647b03cf3c1d11bf211e9fcde4b7f1 (patch)
tree5f5d7d8cb03b365390fc733f1eb677bb343725a1
parent8d4c581a6fb0c69883db7c1c5fe2820d53ccab13 (diff)
downloadlibsurvive-1caa844dad647b03cf3c1d11bf211e9fcde4b7f1.tar.gz
libsurvive-1caa844dad647b03cf3c1d11bf211e9fcde4b7f1.tar.bz2
Windows Compiling
-rw-r--r--include/libsurvive/survive.h46
-rw-r--r--redist/json_helpers.c38
-rw-r--r--redist/os_generic.h2
-rw-r--r--src/survive_config.c8
-rwxr-xr-xsrc/survive_vive.c33
-rw-r--r--winbuild/calibrate/calibrate.vcxproj159
-rw-r--r--winbuild/calibrate/calibrate.vcxproj.filters27
-rw-r--r--winbuild/libsurvive.sln38
-rw-r--r--winbuild/libsurvive/ReadMe.txt29
-rw-r--r--winbuild/libsurvive/libsurvive.vcxproj175
-rw-r--r--winbuild/libsurvive/libsurvive.vcxproj.filters117
11 files changed, 645 insertions, 27 deletions
diff --git a/include/libsurvive/survive.h b/include/libsurvive/survive.h
index 349a93e..db04a9d 100644
--- a/include/libsurvive/survive.h
+++ b/include/libsurvive/survive.h
@@ -136,10 +136,38 @@ void survive_default_angle_process( SurviveObject * so, int sensor_id, int acode
////////////////////// Survive Drivers ////////////////////////////
+// The following macros were taken from StackOverflow here:
+// http://stackoverflow.com/questions/1113409/attribute-constructor-equivalent-in-vc
+// The author, Joe Lowe explicitly released this code into the public domain as part of his post.
+#ifdef __cplusplus
+#define INITIALIZER(f) \
+ static void f(void); \
+ struct f##_t_ { f##_t_(void) { f(); } }; static f##_t_ f##_; \
+ static void f(void)
+#elif defined(_MSC_VER)
+#pragma section(".CRT$XCU",read)
+#define INITIALIZER2_(f,p) \
+ static void f(void); \
+ __declspec(allocate(".CRT$XCU")) void (*f##_)(void) = f; \
+ __pragma(comment(linker,"/include:" p #f "_")) \
+ static void f(void)
+#ifdef _WIN64
+#define INITIALIZER(f) INITIALIZER2_(f,"")
+#else
+#define INITIALIZER(f) INITIALIZER2_(f,"_")
+#endif
+#else
+#define INITIALIZER(f) \
+ static void f(void) __attribute__((constructor)); \
+ static void f(void)
+#endif
+// End macros from StackOverflow.
+
+
void RegisterDriver( const char * name, void * data );
#define REGISTER_LINKTIME( func ) \
- void __attribute__((constructor)) REGISTER##func() { RegisterDriver( #func, &func ); }
+ INITIALIZER(LTRegister##func) { RegisterDriver( #func, &func ); }
@@ -151,19 +179,29 @@ void survive_add_driver( SurviveContext * ctx, void * payload, DeviceDriverCb po
//For lightcap, etc. Don't change this structure at all. Regular vive is dependent on it being exactly as-is.
//When you write drivers, you can use this to send survive lightcap data.
+#ifdef _WIN32
+#pragma pack(push,1)
+#endif
typedef struct
{
uint8_t sensor_id;
uint8_t type; //Mostly unused. Set to 255 to ignore it.
uint16_t length;
uint32_t timestamp;
-} __attribute__((packed)) LightcapElement;
+}
+#ifdef __linux__
+__attribute__((packed))
+#endif
+LightcapElement;
+#ifdef _WIN32
+#pragma pack(pop)
+#endif
//This is the disambiguator function, for taking light timing and figuring out place-in-sweep for a given photodiode.
void handle_lightcap( SurviveObject * so, LightcapElement * le );
-#define SV_INFO( x... ) { char stbuff[1024]; sprintf( stbuff, x ); ctx->notefunction( ctx, stbuff ); }
-#define SV_ERROR( x... ) { char stbuff[1024]; sprintf( stbuff, x ); ctx->faultfunction( ctx, stbuff ); }
+#define SV_INFO( ... ) { char stbuff[1024]; sprintf( stbuff, __VA_ARGS__ ); ctx->notefunction( ctx, stbuff ); }
+#define SV_ERROR( ... ) { char stbuff[1024]; sprintf( stbuff, __VA_ARGS__ ); ctx->faultfunction( ctx, stbuff ); }
#define SV_KILL() exit(0) //XXX This should likely be re-defined.
#endif
diff --git a/redist/json_helpers.c b/redist/json_helpers.c
index 4a3ba55..2413a67 100644
--- a/redist/json_helpers.c
+++ b/redist/json_helpers.c
@@ -7,7 +7,42 @@
#include <string.h>
#include "json_helpers.h"
#include <jsmn.h>
+#include <malloc.h>
+#ifdef _WIN32
+#include <stdarg.h>
+
+// Windows doesn't provide asprintf, so we need to make it.
+int asprintf(char **strp, const char *fmt, ...)
+{
+ char* buff = NULL;
+ va_list listPointer;
+ va_start( listPointer, fmt );
+
+ size_t lenNeeded = _vscprintf(fmt, listPointer) + 1; // add one for a terminating null
+
+ if (lenNeeded > 1)
+ {
+ buff = (char*)malloc(lenNeeded);
+ if (buff)
+ {
+ int bytesWritten = _vsnprintf(buff, lenNeeded, fmt, listPointer);
+ if (bytesWritten < 0)
+ {
+ free(buff);
+ buff = NULL;
+ }
+ }
+ }
+
+ if (strp)
+ {
+ *strp = buff;
+ }
+ return (int)lenNeeded;
+}
+
+#endif
void json_write_float_array(FILE* f, const char* tag, float* v, uint8_t count) {
uint8_t i = 0;
@@ -101,7 +136,8 @@ static uint16_t json_load_array(const char* JSON_STRING, jsmntok_t* tokens, uint
jsmntok_t* t = tokens;
uint16_t i = 0;
- char* values[size];
+ char** values;
+ values = alloca(sizeof(char*) * size);
for (i=0;i<size;++i) {
t = tokens+i;
diff --git a/redist/os_generic.h b/redist/os_generic.h
index aac425b..0924030 100644
--- a/redist/os_generic.h
+++ b/redist/os_generic.h
@@ -1,7 +1,7 @@
#ifndef _OS_GENERIC_H
#define _OS_GENERIC_H
-#if defined( WIN32 ) || defined (WINDOWS)
+#if defined( WIN32 ) || defined (WINDOWS) || defined( _WIN32)
#define USE_WINDOWS
#endif
diff --git a/src/survive_config.c b/src/survive_config.c
index 10da9a6..7435cc4 100644
--- a/src/survive_config.c
+++ b/src/survive_config.c
@@ -3,7 +3,7 @@
#include <assert.h>
#include "survive_config.h"
#include <json_helpers.h>
-
+#include <malloc.h> //for alloca
#include <errno.h>
//#define MAX_CONFIG_ENTRIES 100
@@ -293,7 +293,8 @@ void pop_config_group() {
int parse_floats(char* tag, char** values, uint16_t count) {
uint16_t i = 0;
- FLT f[count];
+ FLT *f;
+ f = alloca(sizeof(FLT) * count);
char* end = NULL;
config_group* cg = cg_stack[cg_stack_head];
@@ -321,7 +322,8 @@ int parse_floats(char* tag, char** values, uint16_t count) {
int parse_uint32(char* tag, char** values, uint16_t count) {
uint16_t i = 0;
- uint32_t l[count];
+ FLT *l;
+ l = alloca(sizeof(FLT) * count);
char* end = NULL;
config_group* cg = cg_stack[cg_stack_head];
diff --git a/src/survive_vive.c b/src/survive_vive.c
index fc05647..116d18b 100755
--- a/src/survive_vive.c
+++ b/src/survive_vive.c
@@ -17,11 +17,11 @@
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
-
+#include <malloc.h> // for alloca
#ifdef HIDAPI
#include <os_generic.h>
-#if defined(WINDOWS) || defined(WIN32)
+#if defined(WINDOWS) || defined(WIN32) || defined (_WIN32)
#include <windows.h>
#undef WCHAR_MAX
#endif
@@ -125,14 +125,12 @@ void survive_data_cb( SurviveUSBInterface * si );
void survive_usb_close( SurviveContext * t );
int survive_usb_init( SurviveViveData * sv, SurviveObject * hmd, SurviveObject *wm0, SurviveObject * wm1, SurviveObject * tr0 );
int survive_usb_poll( SurviveContext * ctx );
-int survive_get_config( char ** config, SurviveViveData * ctx, int devno, int interface, int send_extra_magic );
+int survive_get_config( char ** config, SurviveViveData * ctx, int devno, int iface, int send_extra_magic );
int survive_vive_send_magic(struct SurviveContext * ctx, void * drv, int magic_code, void * data, int datalen );
#ifdef HIDAPI
void * HAPIReceiver( void * v )
{
- char buf[65];
- int res;
SurviveUSBInterface * iface = v;
USBHANDLE * hp = &iface->uh;
@@ -239,13 +237,13 @@ static void debug_cb( struct SurviveUSBInterface * si )
#ifdef HIDAPI
-static inline int update_feature_report(USBHANDLE dev, uint16_t interface, uint8_t * data, int datalen )
+static inline int update_feature_report(USBHANDLE dev, uint16_t iface, uint8_t * data, int datalen )
{
int r = hid_send_feature_report( dev, data, datalen );
// printf( "HUR: (%p) %d (%d) [%d]\n", dev, r, datalen, data[0] );
return r;
}
-static inline int getupdate_feature_report(USBHANDLE dev, uint16_t interface, uint8_t * data, int datalen )
+static inline int getupdate_feature_report(USBHANDLE dev, uint16_t iface, uint8_t * data, size_t datalen )
{
int r = hid_get_feature_report( dev, data, datalen );
// printf( "HGR: (%p) %d (%d) (%d)\n", dev, r, datalen, data[0] );
@@ -277,13 +275,13 @@ static inline int getupdate_feature_report(libusb_device_handle* dev, uint16_t i
#endif
-static inline int hid_get_feature_report_timeout(USBHANDLE device, uint16_t interface, unsigned char *buf, size_t len )
+static inline int hid_get_feature_report_timeout(USBHANDLE device, uint16_t iface, unsigned char *buf, size_t len )
{
int ret;
uint8_t i = 0;
for (i = 0; i < 50; i++)
{
- ret = getupdate_feature_report(device, interface, buf, len);
+ ret = getupdate_feature_report(device, iface, buf, len);
if( ret != -9 && ( ret != -1 || errno != EPIPE ) ) return ret;
OGUSleep( 1000 );
}
@@ -604,7 +602,7 @@ int survive_vive_usb_poll( struct SurviveContext * ctx, void * v )
int survive_get_config( char ** config, struct SurviveViveData * sv, int devno, int iface, int send_extra_magic )
{
struct SurviveContext * ctx = sv->ctx;
- int i, ret, count = 0, size = 0;
+ int ret, count = 0, size = 0;
uint8_t cfgbuff[64];
uint8_t compressed_data[8192];
uint8_t uncompressed_data[65536];
@@ -730,14 +728,13 @@ int survive_get_config( char ** config, struct SurviveViveData * sv, int devno,
static void handle_watchman( struct SurviveObject * w, uint8_t * readdata )
{
- int i;
uint8_t startread[29];
memcpy( startread, readdata, 29 );
#if 0
printf( "DAT: " );
- for( i = 0; i < 29; i++ )
+ for(int i = 0; i < 29; i++ )
{
printf( "%02x ", readdata[i] );
}
@@ -823,7 +820,6 @@ static void handle_watchman( struct SurviveObject * w, uint8_t * readdata )
if( qty )
{
- int j;
qty++;
readdata--;
*readdata = type; //Put 'type' back on stack.
@@ -846,7 +842,6 @@ static void handle_watchman( struct SurviveObject * w, uint8_t * readdata )
const int nrtime = sizeof(times)/sizeof(uint32_t);
int timecount = 0;
int leds;
- int parameters;
int fault = 0;
///Handle uint32_tifying (making sure we keep it incrementing)
@@ -900,7 +895,8 @@ static void handle_watchman( struct SurviveObject * w, uint8_t * readdata )
//Second, go through all LEDs and extract the lightevent from them.
{
- uint8_t marked[nrtime];
+ uint8_t *marked;
+ marked = alloca(nrtime);
memset( marked, 0, sizeof( marked ) );
int i, parpl = 0;
timecount--;
@@ -1141,7 +1137,6 @@ static int ParsePoints( SurviveContext * ctx, SurviveObject * so, char * ct0conf
{
tk = &t[i+2+k*4];
- FLT vals[3];
int m;
for( m = 0; m < 3; m++ )
{
@@ -1264,7 +1259,7 @@ int survive_vive_close( SurviveContext * ctx, void * driver )
int DriverRegHTCVive( SurviveContext * ctx )
{
- int i, r;
+ int r;
SurviveObject * hmd = calloc( 1, sizeof( SurviveObject ) );
SurviveObject * wm0 = calloc( 1, sizeof( SurviveObject ) );
SurviveObject * wm1 = calloc( 1, sizeof( SurviveObject ) );
@@ -1273,7 +1268,9 @@ int DriverRegHTCVive( SurviveContext * ctx )
sv->ctx = ctx;
- #ifdef WINDOWS
+ #ifdef _WIN32
+ CreateDirectoryA("calinfo", NULL);
+ #elif defined WINDOWS
mkdir( "calinfo" );
#else
mkdir( "calinfo", 0755 );
diff --git a/winbuild/calibrate/calibrate.vcxproj b/winbuild/calibrate/calibrate.vcxproj
new file mode 100644
index 0000000..53492e9
--- /dev/null
+++ b/winbuild/calibrate/calibrate.vcxproj
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <VCProjectVersion>15.0</VCProjectVersion>
+ <ProjectGuid>{A60984C4-0D12-423B-AED7-EBE4AD3F1C6B}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>calibrate</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>HIDAPI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\windows;..\..\include\libsurvive;..\..\redist;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>HIDAPI;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\windows;..\..\include\libsurvive;..\..\redist;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>HIDAPI;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\windows;..\..\include\libsurvive;..\..\redist;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>HIDAPI;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\windows;..\..\include\libsurvive;..\..\redist;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\calibrate.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\windows\hidapi.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\libsurvive\libsurvive.vcxproj">
+ <Project>{435cfd2c-8724-42ee-8fde-71ef7d2c6b2f}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/winbuild/calibrate/calibrate.vcxproj.filters b/winbuild/calibrate/calibrate.vcxproj.filters
new file mode 100644
index 0000000..546497e
--- /dev/null
+++ b/winbuild/calibrate/calibrate.vcxproj.filters
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\calibrate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\windows\hidapi.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/winbuild/libsurvive.sln b/winbuild/libsurvive.sln
new file mode 100644
index 0000000..8924631
--- /dev/null
+++ b/winbuild/libsurvive.sln
@@ -0,0 +1,38 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26228.9
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "calibrate", "calibrate\calibrate.vcxproj", "{A60984C4-0D12-423B-AED7-EBE4AD3F1C6B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsurvive", "libsurvive\libsurvive.vcxproj", "{435CFD2C-8724-42EE-8FDE-71EF7D2C6B2F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A60984C4-0D12-423B-AED7-EBE4AD3F1C6B}.Debug|x64.ActiveCfg = Debug|x64
+ {A60984C4-0D12-423B-AED7-EBE4AD3F1C6B}.Debug|x64.Build.0 = Debug|x64
+ {A60984C4-0D12-423B-AED7-EBE4AD3F1C6B}.Debug|x86.ActiveCfg = Debug|Win32
+ {A60984C4-0D12-423B-AED7-EBE4AD3F1C6B}.Debug|x86.Build.0 = Debug|Win32
+ {A60984C4-0D12-423B-AED7-EBE4AD3F1C6B}.Release|x64.ActiveCfg = Release|x64
+ {A60984C4-0D12-423B-AED7-EBE4AD3F1C6B}.Release|x64.Build.0 = Release|x64
+ {A60984C4-0D12-423B-AED7-EBE4AD3F1C6B}.Release|x86.ActiveCfg = Release|Win32
+ {A60984C4-0D12-423B-AED7-EBE4AD3F1C6B}.Release|x86.Build.0 = Release|Win32
+ {435CFD2C-8724-42EE-8FDE-71EF7D2C6B2F}.Debug|x64.ActiveCfg = Debug|x64
+ {435CFD2C-8724-42EE-8FDE-71EF7D2C6B2F}.Debug|x64.Build.0 = Debug|x64
+ {435CFD2C-8724-42EE-8FDE-71EF7D2C6B2F}.Debug|x86.ActiveCfg = Debug|Win32
+ {435CFD2C-8724-42EE-8FDE-71EF7D2C6B2F}.Debug|x86.Build.0 = Debug|Win32
+ {435CFD2C-8724-42EE-8FDE-71EF7D2C6B2F}.Release|x64.ActiveCfg = Release|x64
+ {435CFD2C-8724-42EE-8FDE-71EF7D2C6B2F}.Release|x64.Build.0 = Release|x64
+ {435CFD2C-8724-42EE-8FDE-71EF7D2C6B2F}.Release|x86.ActiveCfg = Release|Win32
+ {435CFD2C-8724-42EE-8FDE-71EF7D2C6B2F}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/winbuild/libsurvive/ReadMe.txt b/winbuild/libsurvive/ReadMe.txt
new file mode 100644
index 0000000..a276380
--- /dev/null
+++ b/winbuild/libsurvive/ReadMe.txt
@@ -0,0 +1,29 @@
+========================================================================
+ STATIC LIBRARY : libsurvive Project Overview
+========================================================================
+
+AppWizard has created this libsurvive library project for you.
+
+No source files were created as part of your project.
+
+
+libsurvive.vcxproj
+ This is the main project file for VC++ projects generated using an Application Wizard.
+ It contains information about the version of Visual C++ that generated the file, and
+ information about the platforms, configurations, and project features selected with the
+ Application Wizard.
+
+libsurvive.vcxproj.filters
+ This is the filters file for VC++ projects generated using an Application Wizard.
+ It contains information about the association between the files in your project
+ and the filters. This association is used in the IDE to show grouping of files with
+ similar extensions under a specific node (for e.g. ".cpp" files are associated with the
+ "Source Files" filter).
+
+/////////////////////////////////////////////////////////////////////////////
+Other notes:
+
+AppWizard uses "TODO:" comments to indicate parts of the source code you
+should add to or customize.
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/winbuild/libsurvive/libsurvive.vcxproj b/winbuild/libsurvive/libsurvive.vcxproj
new file mode 100644
index 0000000..225cab6
--- /dev/null
+++ b/winbuild/libsurvive/libsurvive.vcxproj
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <VCProjectVersion>15.0</VCProjectVersion>
+ <ProjectGuid>{435CFD2C-8724-42EE-8FDE-71EF7D2C6B2F}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>libsurvive</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>NOZLIB;_CRT_SECURE_NO_WARNINGS;HIDAPI;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\windows;..\..\include\libsurvive;..\..\redist;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>NOZLIB;_CRT_SECURE_NO_WARNINGS;HIDAPI;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\windows;..\..\include\libsurvive;..\..\redist;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>NOZLIB;_CRT_SECURE_NO_WARNINGS;HIDAPI;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\windows;..\..\include\libsurvive;..\..\redist;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>NOZLIB;_CRT_SECURE_NO_WARNINGS;HIDAPI;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\windows;..\..\include\libsurvive;..\..\redist;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <Text Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\redist\crc32.c" />
+ <ClCompile Include="..\..\redist\DrawFunctions.c" />
+ <ClCompile Include="..\..\redist\jsmn.c" />
+ <ClCompile Include="..\..\redist\json_helpers.c" />
+ <ClCompile Include="..\..\redist\os_generic.c" />
+ <ClCompile Include="..\..\redist\puff.c" />
+ <ClCompile Include="..\..\redist\WinDriver.c" />
+ <ClCompile Include="..\..\src\ootx_decoder.c" />
+ <ClCompile Include="..\..\src\poser_charlesslow.c" />
+ <ClCompile Include="..\..\src\poser_daveortho.c" />
+ <ClCompile Include="..\..\src\poser_dummy.c" />
+ <ClCompile Include="..\..\src\survive.c" />
+ <ClCompile Include="..\..\src\survive_cal.c" />
+ <ClCompile Include="..\..\src\survive_config.c" />
+ <ClCompile Include="..\..\src\survive_data.c" />
+ <ClCompile Include="..\..\src\survive_driverman.c" />
+ <ClCompile Include="..\..\src\survive_process.c" />
+ <ClCompile Include="..\..\src\survive_usb.c" />
+ <ClCompile Include="..\..\src\survive_vive.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\include\libsurvive\poser.h" />
+ <ClInclude Include="..\..\include\libsurvive\survive.h" />
+ <ClInclude Include="..\..\include\libsurvive\survive_types.h" />
+ <ClInclude Include="..\..\redist\crc32.h" />
+ <ClInclude Include="..\..\redist\DrawFunctions.h" />
+ <ClInclude Include="..\..\redist\jsmn.h" />
+ <ClInclude Include="..\..\redist\json_helpers.h" />
+ <ClInclude Include="..\..\redist\os_generic.h" />
+ <ClInclude Include="..\..\src\ootx_decoder.h" />
+ <ClInclude Include="..\..\src\survive_cal.h" />
+ <ClInclude Include="..\..\src\survive_config.h" />
+ <ClInclude Include="..\..\src\survive_internal.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/winbuild/libsurvive/libsurvive.vcxproj.filters b/winbuild/libsurvive/libsurvive.vcxproj.filters
new file mode 100644
index 0000000..0a3b6c3
--- /dev/null
+++ b/winbuild/libsurvive/libsurvive.vcxproj.filters
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <Text Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\src\ootx_decoder.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\poser_charlesslow.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\poser_daveortho.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\poser_dummy.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\survive.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\survive_cal.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\survive_config.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\survive_data.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\survive_driverman.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\survive_process.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\survive_usb.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\survive_vive.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\redist\os_generic.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\redist\puff.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\redist\DrawFunctions.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\redist\WinDriver.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\redist\json_helpers.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\redist\jsmn.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\redist\crc32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\src\ootx_decoder.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\survive_cal.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\survive_config.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\survive_internal.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\libsurvive\poser.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\libsurvive\survive.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\libsurvive\survive_types.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\redist\os_generic.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\redist\DrawFunctions.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\redist\json_helpers.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\redist\jsmn.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\redist\crc32.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file