Move source header files to include/ move installed ones to $(includedir)/LibVR.
authorThibaut Girka <thib@sitedethib.com>
Sun, 25 Aug 2013 14:57:34 +0200
changeset 26 1d298feac873
parent 25 886eb810586c
child 27 d55ddf46b66d
Move source header files to include/ move installed ones to $(includedir)/LibVR.
include/display_info.h
include/hmd.h
include/stereo.h
pkg-config/libvr.pc.in
src/Makefile.am
src/display_info.h
src/hmd.h
src/stereo.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/display_info.h	Sun Aug 25 14:57:34 2013 +0200
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2013 Thibaut Girka <thib@sitedethib.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef __DISPLAY_INFO_H__
+#define __DISPLAY_INFO_H__
+
+#include <stdint.h>
+
+struct display_info
+{
+  uint8_t distortion_type;
+  uint16_t h_resolution, v_resolution;
+  float h_screen_size, v_screen_size;
+  float v_center;
+  float lens_separation;
+  float eye_to_screen[2];
+  float distortion_k[6];
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/hmd.h	Sun Aug 25 14:57:34 2013 +0200
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2013 Thibaut Girka <thib@sitedethib.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef __HMD_H__
+#define __HMD_H__
+
+#include "display_info.h"
+#include "stereo.h"
+
+#define HMD_CAPABILITY_NONE     0
+#define HMD_CAPABILITY_ROTATION 1
+#define HMD_CAPABILITY_POSITION 2
+
+struct hmd;
+
+struct hmd *hmd_open_first(unsigned int min_caps);
+void hmd_close(struct hmd *hmd);
+
+unsigned int hmd_get_capabilities(struct hmd *hmd);
+int hmd_get_display_info(struct hmd *hmd, struct display_info *info);
+int hmd_get_stereo_config(struct hmd *hmd, struct stereo_config *config);
+
+/* Update internal data.
+ “time” is expressed in ms and its value should be monotonic.
+ If the update is successful, “time” is modified to the time
+ the next update call should run. A value of 0 means the time
+ the next update call is performed is not important.
+ The user is responsible for running it frequently enough */
+int hmd_update(struct hmd *hmd, unsigned int *time);
+
+/* quat = {w, x, y, z} */
+int hmd_get_rotation(struct hmd *hmd, float quat[4]);
+int hmd_get_position(struct hmd *hmd, float vec[3]);
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/stereo.h	Sun Aug 25 14:57:34 2013 +0200
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2013 Thibaut Girka <thib@sitedethib.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef __STEREO_H__
+#define __STEREO_H__
+#include "display_info.h"
+
+struct projection_config {
+  float yfov;
+  float aspect_ratio;
+  float projection_offset;
+};
+
+struct distortion_config {
+  float distortion_k[4];
+  float scale;
+};
+
+
+struct stereo_config {
+  struct projection_config proj;
+  struct distortion_config distort;
+};
+
+
+void stereo_config_from_display_info(const struct display_info *d,
+                                     struct stereo_config *conf);
+
+#endif
--- a/pkg-config/libvr.pc.in	Sun Aug 25 13:57:47 2013 +0200
+++ b/pkg-config/libvr.pc.in	Sun Aug 25 14:57:34 2013 +0200
@@ -10,4 +10,4 @@
 Requires:
 Libs: -L${libdir} -lvr
 Libs.private: -lm @hidapi_LIBS@
-Cflags: -I${includedir}
+Cflags: -I${includedir}/LibVR
--- a/src/Makefile.am	Sun Aug 25 13:57:47 2013 +0200
+++ b/src/Makefile.am	Sun Aug 25 14:57:34 2013 +0200
@@ -10,11 +10,14 @@
                    backends/rift.h
 
 #TODO: check for -lm
-libvr_la_LDFLAGS = $(hidapi_LIBS)$ -lm -no-undefined -version-info @LT_VERSION_INFO@
-libvr_la_CFLAGS = $(hidapi_CFLAGS)$
+libvr_la_LDFLAGS = $(hidapi_LIBS) -lm -no-undefined -version-info $(LT_VERSION_INFO)
+libvr_la_CFLAGS = $(hidapi_CFLAGS) -I $(top_srcdir)/include/
 
-include_HEADERS = hmd.h stereo.h display_info.h
+libvr_includedir = $(includedir)/LibVR/
+libvr_include_HEADERS = $(top_srcdir)/include/hmd.h \
+                        $(top_srcdir)/include/stereo.h \
+                        $(top_srcdir)/include/display_info.h
 
-noinst_PROGRAMS = test
-test_SOURCES = test.c
-test_LDADD = libvr.la
+# noinst_PROGRAMS = test
+# test_SOURCES = test.c
+# test_LDADD = libvr.la
--- a/src/display_info.h	Sun Aug 25 13:57:47 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2013 Thibaut Girka <thib@sitedethib.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef __DISPLAY_INFO_H__
-#define __DISPLAY_INFO_H__
-
-#include <stdint.h>
-
-struct display_info
-{
-  uint8_t distortion_type;
-  uint16_t h_resolution, v_resolution;
-  float h_screen_size, v_screen_size;
-  float v_center;
-  float lens_separation;
-  float eye_to_screen[2];
-  float distortion_k[6];
-};
-
-#endif
--- a/src/hmd.h	Sun Aug 25 13:57:47 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013 Thibaut Girka <thib@sitedethib.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef __HMD_H__
-#define __HMD_H__
-
-#include "display_info.h"
-#include "stereo.h"
-
-#define HMD_CAPABILITY_NONE     0
-#define HMD_CAPABILITY_ROTATION 1
-#define HMD_CAPABILITY_POSITION 2
-
-struct hmd;
-
-struct hmd *hmd_open_first(unsigned int min_caps);
-void hmd_close(struct hmd *hmd);
-
-unsigned int hmd_get_capabilities(struct hmd *hmd);
-int hmd_get_display_info(struct hmd *hmd, struct display_info *info);
-int hmd_get_stereo_config(struct hmd *hmd, struct stereo_config *config);
-
-/* Update internal data.
- “time” is expressed in ms and its value should be monotonic.
- If the update is successful, “time” is modified to the time
- the next update call should run. A value of 0 means the time
- the next update call is performed is not important.
- The user is responsible for running it frequently enough */
-int hmd_update(struct hmd *hmd, unsigned int *time);
-
-/* quat = {w, x, y, z} */
-int hmd_get_rotation(struct hmd *hmd, float quat[4]);
-int hmd_get_position(struct hmd *hmd, float vec[3]);
-
-#endif
--- a/src/stereo.h	Sun Aug 25 13:57:47 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2013 Thibaut Girka <thib@sitedethib.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef __STEREO_H__
-#define __STEREO_H__
-#include "display_info.h"
-
-struct projection_config {
-  float yfov;
-  float aspect_ratio;
-  float projection_offset;
-};
-
-struct distortion_config {
-  float distortion_k[4];
-  float scale;
-};
-
-
-struct stereo_config {
-  struct projection_config proj;
-  struct distortion_config distort;
-};
-
-
-void stereo_config_from_display_info(const struct display_info *d,
-                                     struct stereo_config *conf);
-
-#endif