summaryrefslogtreecommitdiffhomepage
path: root/tracker-rs/rs_impl/attic
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-08-28 10:39:40 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-08-28 10:40:14 +0200
commitb6c1c5ec8768eae71f3492a4e5c92cac65cee5a1 (patch)
tree61ee5d7825d407b2648424bc110f9fc18af25420 /tracker-rs/rs_impl/attic
parentdacec3441a491c132443b9c8bb066ca514cb3335 (diff)
tracker/rs: connect rs_impl to build
Pinging @ph0b.
Diffstat (limited to 'tracker-rs/rs_impl/attic')
-rw-r--r--tracker-rs/rs_impl/attic/bin/amd64/.gitignore2
-rw-r--r--tracker-rs/rs_impl/attic/bin/ia32/.gitignore2
-rw-r--r--tracker-rs/rs_impl/attic/build.bat29
-rw-r--r--tracker-rs/rs_impl/attic/build_common.bat21
-rw-r--r--tracker-rs/rs_impl/attic/udp_sender.cpp53
5 files changed, 107 insertions, 0 deletions
diff --git a/tracker-rs/rs_impl/attic/bin/amd64/.gitignore b/tracker-rs/rs_impl/attic/bin/amd64/.gitignore
new file mode 100644
index 00000000..59314700
--- /dev/null
+++ b/tracker-rs/rs_impl/attic/bin/amd64/.gitignore
@@ -0,0 +1,2 @@
+/*.exp
+/*.obj
diff --git a/tracker-rs/rs_impl/attic/bin/ia32/.gitignore b/tracker-rs/rs_impl/attic/bin/ia32/.gitignore
new file mode 100644
index 00000000..59314700
--- /dev/null
+++ b/tracker-rs/rs_impl/attic/bin/ia32/.gitignore
@@ -0,0 +1,2 @@
+/*.exp
+/*.obj
diff --git a/tracker-rs/rs_impl/attic/build.bat b/tracker-rs/rs_impl/attic/build.bat
new file mode 100644
index 00000000..3d5e8bc0
--- /dev/null
+++ b/tracker-rs/rs_impl/attic/build.bat
@@ -0,0 +1,29 @@
+@echo off
+
+setlocal
+
+IF DEFINED VS150COMNTOOLS (
+ if exist "%VS150COMNTOOLS%\..\..\VC\vcvarsall.bat" (
+ set vs_dir="%VS150COMNTOOLS%\..\..\VC"
+ set vs_64=amd64
+ ) else (
+ rem it installed vcvarsall.bat here for me for some reason -sh 20160827
+ set vs_dir="%VS150COMNTOOLS%\..\ide\vc"
+ set vs_64=amd64
+ )) else (
+ set vs_dir="%VS140COMNTOOLS%\..\..\VC"
+ set vs_64=amd64
+ )
+
+cd /d "%~dp0"
+if %errorlevel% neq 0 exit /b 1
+
+set rs_objs=ftnoir_tracker_rs_impl.obj libpxc.obj
+
+set rs_subdir=ia32&set vs_var=x86
+call ".\build_common.bat" || exit /b 1
+
+set rs_subdir=amd64&set vs_var=%vs_64%
+call ".\build_common.bat" || exit /b 1
+
+exit /b 0
diff --git a/tracker-rs/rs_impl/attic/build_common.bat b/tracker-rs/rs_impl/attic/build_common.bat
new file mode 100644
index 00000000..c37e0ae8
--- /dev/null
+++ b/tracker-rs/rs_impl/attic/build_common.bat
@@ -0,0 +1,21 @@
+@echo off
+
+setlocal
+
+cd /d .\bin\%rs_subdir% || exit 1
+
+echo --- %rs_subdir%
+
+set rice_ld=/OPT:REF /OPT:ICF=10 /DEBUG /DYNAMICBASE /NXCOMPAT /LTCG
+set rice_lib=
+set rice_cc=/Ox /arch:SSE2 /EHscr /fp:fast /GS- /GF /GR- /Gy /MT /Y- /Zi /W1 /GL /Zi
+set libs=advapi32.lib
+
+if not exist %vs_dir%\vcvarsall.bat exit /b 1
+call %vs_dir%\vcvarsall %vs_var% || exit /b 1
+if ["%libpath%"] == [""] exit /b 1
+
+cl /c /nologo -DEXPORT_RS_IMPL -DUNICODE -D_UNICODE -MT %rice_cc% /I "%RSSDK_DIR%\opensource\include" ..\..\ftnoir_tracker_rs_impl.cpp "%RSSDK_DIR%\opensource\src\libpxc\libpxc.cpp" || exit /b 1
+lib /nologo %rice_lib% %rs_objs% %libs% /OUT:rs-impl.lib || exit /b 1
+
+exit /b 0
diff --git a/tracker-rs/rs_impl/attic/udp_sender.cpp b/tracker-rs/rs_impl/attic/udp_sender.cpp
new file mode 100644
index 00000000..095edd8f
--- /dev/null
+++ b/tracker-rs/rs_impl/attic/udp_sender.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, Intel Corporation
+ * Author: Xavier Hallade <xavier.hallade@intel.com>
+ * Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "ftnoir_tracker_rs_impl.h"
+#include <winsock2.h>
+#include <Ws2tcpip.h>
+#include <commctrl.h>
+#include <cstdlib>
+
+#define UDP_PORT 4242
+
+int main(){
+ double pose[6] = { 0., 0., 0., 0., 0., 0. };
+ struct sockaddr_in socketInfo;
+ SOCKET s = 0;
+ WSADATA wsa;
+
+ int retStatus = rs_tracker_impl_start();
+ if (retStatus != 0){
+ exit(retStatus);
+ }
+
+ if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0) //init winsocketapi
+ exit(EXIT_FAILURE);
+
+ memset(&socketInfo, 0, sizeof(socketInfo));
+ socketInfo.sin_family = AF_INET;
+ socketInfo.sin_port = htons(UDP_PORT);
+ InetPton(AF_INET, L"127.0.0.1", &socketInfo.sin_addr.S_un.S_addr);
+
+ if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == SOCKET_ERROR) //create UDP socket
+ exit(EXIT_FAILURE);
+
+ for(;;) {
+ retStatus = rs_tracker_impl_update_pose(pose);
+ if(retStatus == 0){ //no error
+ if (sendto(s, (char*)&pose, sizeof(pose), 0, (struct sockaddr *) &socketInfo, sizeof(socketInfo)) == SOCKET_ERROR) //send new data
+ exit(EXIT_FAILURE);
+ }
+
+ if(retStatus != 0 && retStatus != -303)// -303=timeout and 0 are ok, else we've got to stop.
+ break;
+ }
+
+ closesocket(s);
+ WSACleanup();
+
+ return retStatus;
+}