├── AS3Client ├── KinectSocket.as ├── Main.as ├── Pointer.as └── Skeleton.as ├── KinectGate.sln ├── KinectGate ├── KinectGate.cpp ├── KinectGate.vcxproj ├── KinectGate.vcxproj.filters ├── KinectServer.cpp ├── KinectServer.h ├── ReadMe.txt ├── stdafx.cpp ├── stdafx.h └── targetver.h └── README /AS3Client/KinectSocket.as: -------------------------------------------------------------------------------- 1 | package { 2 | import flash.display.Graphics; 3 | import flash.display.Sprite; 4 | import flash.events.IOErrorEvent; 5 | import flash.events.ProgressEvent; 6 | import flash.geom.Point; 7 | import flash.net.Socket; 8 | import flash.utils.ByteArray; 9 | import flash.utils.Endian; 10 | import flash.utils.setTimeout; 11 | 12 | /** 13 | * @author den.ivanov 14 | */ 15 | public class KinectSocket extends Sprite { 16 | private var socket : Socket; 17 | private var bw : ByteArray; 18 | private var skeletonsCount : int = 0; 19 | private var skeletons : Vector.; 20 | private var centralSkeleton : int = -1; 21 | 22 | public function KinectSocket() { 23 | skeletons = new Vector.(Skeleton.NUI_SKELETON_COUNT, true); 24 | 25 | for (var i : int = 0;i < Skeleton.NUI_SKELETON_COUNT;i++) { 26 | skeletons[i] = new Skeleton(i); 27 | } 28 | 29 | bw = new ByteArray(); 30 | bw.length = 100; 31 | 32 | socket = new Socket(); 33 | socket.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); 34 | socket.addEventListener(ProgressEvent.SOCKET_DATA, getData); 35 | connectToSocket(); 36 | } 37 | 38 | private function connectToSocket() : void { 39 | trace("connect to socket server"); 40 | socket.connect("localhost", 6001); 41 | socket.writeByte(1); 42 | socket.flush(); 43 | } 44 | 45 | private function ioErrorHandler(event : IOErrorEvent) : void { 46 | trace("error connecting to socket server"); 47 | setTimeout(connectToSocket, 3000); 48 | } 49 | 50 | public function getPoint() : Point { 51 | if (centralSkeleton == -1) { 52 | return new Point(-1, -1); 53 | } else { 54 | return new Point(skeletons[centralSkeleton].joints[11].x,skeletons[centralSkeleton].joints[11].y); 55 | } 56 | } 57 | 58 | private function getData(event : ProgressEvent) : void { 59 | var g : Graphics = this.graphics; 60 | //g.clear(); 61 | //g.beginFill(0x000000, 0.1); 62 | //g.drawRect(0, 0, 640, 480); 63 | //g.endFill(); 64 | //trace("data", socket.bytesAvailable); 65 | if (socket.bytesAvailable > 0) { 66 | socket.readBytes(bw, 0, socket.bytesAvailable); 67 | bw.position = 0; 68 | bw.endian = Endian.LITTLE_ENDIAN; 69 | // parse data 70 | skeletonsCount = bw.readFloat(); 71 | 72 | if (skeletonsCount == 0) { 73 | centralSkeleton = -1; 74 | } else { 75 | for (var n : int = 0;n < 6;n++) { 76 | skeletons[skeletonID].reset(); 77 | } 78 | 79 | var isCentralSkeletonStillHere : Boolean = false; 80 | var newCentralSkeleton : int = -1; 81 | var centerX : Number = 800/2; 82 | 83 | for (var i : int = 0;i < skeletonsCount;i++) { 84 | var skeletonID : int = bw.readFloat(); 85 | if (skeletonID == centralSkeleton) { 86 | isCentralSkeletonStillHere = true; 87 | } 88 | for (var j : int = 0;j < Skeleton.NUI_SKELETON_POSITION_COUNT;j++) { 89 | var jointX : Number = bw.readFloat(); 90 | var jointY : Number = bw.readFloat(); 91 | 92 | skeletons[skeletonID].updateJoint(j, Math.round(jointX*800), Math.round(jointY*600)); 93 | } 94 | // test for new central 95 | var dist : Number = Math.abs(skeletons[skeletonID].joints[0].x - 800/2); 96 | if (dist < centerX) { 97 | centerX = dist; 98 | newCentralSkeleton = skeletonID; 99 | } 100 | // draw skeleton 101 | skeletons[skeletonID].draw(this); 102 | } 103 | if (!isCentralSkeletonStillHere) { 104 | centralSkeleton = newCentralSkeleton; 105 | } 106 | } 107 | 108 | socket.writeByte(1); 109 | socket.flush(); 110 | } 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /AS3Client/Main.as: -------------------------------------------------------------------------------- 1 | package { 2 | import flash.display.BlendMode; 3 | import flash.display.Sprite; 4 | import flash.display.StageAlign; 5 | import flash.display.StageScaleMode; 6 | import flash.events.Event; 7 | import flash.filesystem.File; 8 | import flash.geom.Point; 9 | import flash.net.URLLoader; 10 | import flash.net.URLRequest; 11 | import flash.ui.Mouse; 12 | 13 | /** 14 | 15 | * @author den.ivanov 16 | */ 17 | [SWF(backgroundColor="#FFFFFF", frameRate="30", width="800", height="600")] 18 | public class Main extends Sprite { 19 | private var socket : KinectSocket; 20 | private var pointer : Pointer; 21 | 22 | public function CornerPagesAIR() { 23 | 24 | stage.scaleMode = StageScaleMode.NO_SCALE; 25 | stage.align = StageAlign.TOP_LEFT; 26 | 27 | Mouse.hide(); 28 | 29 | 30 | // object controlled by right hand 31 | pointer = new Pointer(); 32 | addChild(pointer); 33 | 34 | 35 | // Add any Display object for hittesting with Pointer 36 | //pointer.addZone(cb); 37 | 38 | socket = new KinectSocket(); 39 | addChild(socket); 40 | 41 | addEventListener(Event.ENTER_FRAME, updateFrame); 42 | 43 | } 44 | 45 | private function updateFrame(e : Event) : void { 46 | var newPoint : Point = getPointer(); 47 | 48 | pointer.x = newPoint.x; 49 | pointer.y = newPoint.y; 50 | 51 | pointer.check(newPoint); 52 | 53 | } 54 | 55 | private function getPointer() : Point { 56 | // just for testing 57 | // var p:Point = new Point(stage.mouseX, stage.mouseY); 58 | 59 | var p : Point = socket.getPoint(); 60 | return p; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /AS3Client/Pointer.as: -------------------------------------------------------------------------------- 1 | package { 2 | import assets.PointerAsset; 3 | 4 | import flash.display.DisplayObject; 5 | import flash.display.Graphics; 6 | import flash.events.Event; 7 | import flash.geom.Point; 8 | 9 | /** 10 | * @author den.ivanov 11 | */ 12 | public class Pointer extends PointerAsset { 13 | private var zones : Array; 14 | public var currentZone : DisplayObject; 15 | public var previousZone : DisplayObject; 16 | private var zoneTime : int = 0; 17 | private var maxZoneTime : Number = 30; 18 | 19 | public function Pointer() { 20 | zones = new Array(); 21 | } 22 | 23 | public function addZone(d : DisplayObject) : void { 24 | zones.push(d); 25 | } 26 | 27 | public function check(p : Point) : void { 28 | var isOverZone : Boolean = false; 29 | 30 | for (var i : int = 0;i < zones.length;i++) { 31 | var checkZone : DisplayObject = DisplayObject(zones[i]); 32 | if (checkZone.hitTestPoint(p.x, p.y, true)) { 33 | isOverZone = true; 34 | if (currentZone == checkZone && checkZone != previousZone) { 35 | zoneTime++; 36 | if (zoneTime >= maxZoneTime) { 37 | previousZone = currentZone; 38 | zoneTime = 0; 39 | currentZone.dispatchEvent(new Event(Event.CHANGE)); 40 | } 41 | } else { 42 | zoneTime = 0; 43 | currentZone = checkZone; 44 | } 45 | } 46 | } 47 | if (isOverZone == false) { 48 | currentZone = null; 49 | previousZone = null; 50 | zoneTime = 0; 51 | } 52 | 53 | var g : Graphics = this.graphics; 54 | g.clear(); 55 | g.lineStyle(10, 0x004a9f, 1); 56 | var aStep : Number = Math.PI * 2 / maxZoneTime; 57 | for (i = 0;i < zoneTime;i++) { 58 | var px : Number = 45 * Math.cos(i * aStep); 59 | var py : Number = 45 * Math.sin(i * aStep); 60 | if (i == 0) { 61 | g.moveTo(px, py); 62 | } else { 63 | g.lineTo(px, py); 64 | } 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /AS3Client/Skeleton.as: -------------------------------------------------------------------------------- 1 | package { 2 | import flash.display.Graphics; 3 | import flash.display.Sprite; 4 | import flash.geom.Point; 5 | 6 | /** 7 | * @author den.ivanov 8 | */ 9 | public class Skeleton { 10 | public var isActive : Boolean = false; 11 | public var id : int = -1; 12 | public var joints : Vector.; 13 | public static const NUI_SKELETON_POSITION_COUNT : int = 20; 14 | public static const NUI_SKELETON_COUNT : int = 6; 15 | 16 | public function Skeleton(_id : int = -1) { 17 | joints = new Vector.(NUI_SKELETON_POSITION_COUNT, true); 18 | 19 | isActive = false; 20 | id = _id; 21 | for (var i : int = 0;i < NUI_SKELETON_POSITION_COUNT;i++) { 22 | joints[i] = new Point(0, 0); 23 | } 24 | } 25 | 26 | public function updateJoint(_index : int, _x : Number, _y : Number) : void { 27 | joints[_index].x = _x; 28 | joints[_index].y = _y; 29 | } 30 | 31 | public function draw(s : Sprite, _color : int = 0xff0000) : void { 32 | var g : Graphics = s.graphics; 33 | 34 | var size : Number = 10; 35 | 36 | var colors:Array = [0xff0000,0xff0000,0xff0000,0x00ff00,0xff0000,0xff0000,0xff0000,0xffff00,0xff0000,0xff0000,0xff0000,0x0000ff,0xff0000,0xff0000,0xff0000,0xff0000,0xff0000,0xff0000,0xff0000,0xff0000]; 37 | 38 | for (var i : int = 0;i < NUI_SKELETON_POSITION_COUNT;i++) { 39 | g.beginFill(colors[i], 1); 40 | g.drawRect(joints[i].x - size / 2, joints[i].y - size / 2, size, size); 41 | g.endFill(); 42 | } 43 | } 44 | 45 | public function reset() : void { 46 | isActive = false; 47 | for (var i : int = 0;i < NUI_SKELETON_POSITION_COUNT;i++) { 48 | joints[i] = new Point(0, 0); 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /KinectGate.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KinectGate", "KinectGate\KinectGate.vcxproj", "{8F79BF5A-6075-4822-A05F-FE9CCDD09A96}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {8F79BF5A-6075-4822-A05F-FE9CCDD09A96}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {8F79BF5A-6075-4822-A05F-FE9CCDD09A96}.Debug|Win32.Build.0 = Debug|Win32 14 | {8F79BF5A-6075-4822-A05F-FE9CCDD09A96}.Release|Win32.ActiveCfg = Release|Win32 15 | {8F79BF5A-6075-4822-A05F-FE9CCDD09A96}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /KinectGate/KinectGate.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | 3 | #include 4 | #include "MSR_NuiApi.h" 5 | #include "KinectServer.h" 6 | 7 | #pragma comment (lib, "MSRKinectNUI.lib") 8 | 9 | KinectServer server; 10 | 11 | int mixedData[(NUI_SKELETON_POSITION_COUNT+1)*6*4+4]; 12 | 13 | HRESULT hr; 14 | POINT m_Points[NUI_SKELETON_POSITION_COUNT]; 15 | 16 | int trackedCount = 0; 17 | int m_LastSkeletonFoundTime; 18 | bool m_bScreenBlanked; 19 | bool isClientConnected = false; 20 | 21 | void GrabSkeleton() 22 | { 23 | NUI_SKELETON_FRAME SkeletonFrame; 24 | 25 | hr = NuiSkeletonGetNextFrame( 100, &SkeletonFrame ); 26 | if( FAILED( hr ) ) 27 | { 28 | printf("error getting frame\n"); 29 | return; 30 | } 31 | 32 | 33 | bool bFoundSkeleton = true; 34 | 35 | 36 | trackedCount = 0; 37 | 38 | for( int i = 0 ; i < NUI_SKELETON_COUNT ; i++ ) 39 | { 40 | if( SkeletonFrame.SkeletonData[i].eTrackingState == NUI_SKELETON_TRACKED ) 41 | { 42 | bFoundSkeleton = false; 43 | trackedCount++; 44 | } 45 | } 46 | 47 | // no skeletons! 48 | // 49 | if( bFoundSkeleton ) 50 | { 51 | printf("no skeletons!!!\n"); 52 | 53 | } 54 | 55 | // smooth out the skeleton data 56 | NuiTransformSmooth(&SkeletonFrame,NULL); 57 | 58 | // draw each skeleton color according to the slot within they are found. 59 | // 60 | 61 | int width = 640; 62 | int height = 480; 63 | 64 | float fx=0,fy=0; 65 | 66 | float* ptr = (float*)mixedData; 67 | 68 | *ptr = (float) trackedCount; 69 | ++ptr; 70 | 71 | for( int i = 0 ; i < NUI_SKELETON_COUNT ; i++ ) 72 | { 73 | if( SkeletonFrame.SkeletonData[i].eTrackingState == NUI_SKELETON_TRACKED ) 74 | { 75 | *ptr = (float) i; 76 | ++ptr; 77 | 78 | for (int s = 0; s < NUI_SKELETON_POSITION_COUNT; s++) 79 | { 80 | NUI_SKELETON_DATA * pSkel = &SkeletonFrame.SkeletonData[i]; 81 | NuiTransformSkeletonToDepthImageF( pSkel->SkeletonPositions[s], &fx, &fy ); 82 | 83 | //int jointX = (int) ( fx * width + 0.5f ); 84 | //int jointY = (int) ( fy * height + 0.5f ); 85 | 86 | 87 | if (s == 11){ 88 | printf("id = %d, x = %f, y = %f\n",i, fx,fy); 89 | } 90 | 91 | *ptr = fx; 92 | ++ptr; 93 | 94 | *ptr = fy; 95 | ++ptr; 96 | 97 | 98 | } 99 | } 100 | } 101 | } 102 | 103 | 104 | void initKinect(){ 105 | hr = NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON); 106 | if( FAILED( hr ) ) 107 | { 108 | printf("error NuiInitialize...\n"); 109 | return; 110 | } else { 111 | printf("NuiInitialize OK!\n"); 112 | } 113 | // hr = NuiCameraElevationSetAngle(NUI_CAMERA_ELEVATION_MAXIMUM); 114 | // hr = NuiCameraElevationSetAngle(0); 115 | 116 | hr = NuiSkeletonTrackingEnable(NULL,0); 117 | if( FAILED( hr ) ) 118 | { 119 | printf("error NuiSkeletonTrackingEnable\n"); 120 | return; 121 | } else { 122 | printf("NuiSkeletonTrackingEnable ok!\n"); 123 | } 124 | 125 | 126 | } 127 | 128 | int __cdecl main(int argc, char *argv[]) { 129 | 130 | initKinect(); 131 | 132 | server = KinectServer(); 133 | server.init(); 134 | isClientConnected = server.waitForConnection(); 135 | 136 | while (1){ 137 | 138 | while (isClientConnected) { 139 | GrabSkeleton(); 140 | 141 | long dataSize = 4+(NUI_SKELETON_POSITION_COUNT+1)*4*6; 142 | isClientConnected = server.sendData(mixedData,dataSize); 143 | } 144 | 145 | 146 | 147 | isClientConnected = server.waitForConnection(); 148 | } 149 | 150 | server.closeConnection(); 151 | 152 | return 0; 153 | } -------------------------------------------------------------------------------- /KinectGate/KinectGate.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {8F79BF5A-6075-4822-A05F-FE9CCDD09A96} 15 | Win32Proj 16 | KinectGate 17 | 18 | 19 | 20 | Application 21 | true 22 | Unicode 23 | 24 | 25 | Application 26 | false 27 | true 28 | Unicode 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | true 42 | $(MSRKINECTSDK)\inc;$(IncludePath) 43 | $(MSRKINECTSDK)\lib;$(LibraryPath) 44 | AllRules.ruleset 45 | 46 | 47 | false 48 | $(MSRKINECTSDK)\inc;$(IncludePath) 49 | $(MSRKINECTSDK)\lib;$(LibraryPath) 50 | 51 | 52 | 53 | 54 | 55 | Level3 56 | Disabled 57 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 58 | 59 | 60 | Console 61 | true 62 | 63 | 64 | 65 | 66 | Level3 67 | Use 68 | MaxSpeed 69 | true 70 | true 71 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 72 | 73 | 74 | Console 75 | true 76 | true 77 | true 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | Create 93 | Create 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /KinectGate/KinectGate.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | -------------------------------------------------------------------------------- /KinectGate/KinectServer.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "KinectServer.h" 10 | 11 | 12 | #pragma comment (lib, "Ws2_32.lib") 13 | 14 | 15 | #define DEFAULT_BUFLEN 512 16 | #define DEFAULT_PORT "27015" 17 | 18 | 19 | WSADATA wsaData; 20 | SOCKET ListenSocket = INVALID_SOCKET, 21 | ClientSocket = INVALID_SOCKET; 22 | struct addrinfo *result = NULL,hints; 23 | char recvbuf[DEFAULT_BUFLEN]; 24 | int iResult, iSendResult; 25 | int recvbuflen = DEFAULT_BUFLEN; 26 | 27 | int KinectServer::init(){ 28 | 29 | initServer(); 30 | 31 | return 0; 32 | } 33 | 34 | int KinectServer::initServer(){ 35 | 36 | // Initialize Winsock 37 | iResult = WSAStartup(MAKEWORD(2,2), &wsaData); 38 | if (iResult != 0) { 39 | printf("WSAStartup failed with error: %d\n", iResult); 40 | return 1; 41 | } 42 | 43 | 44 | ZeroMemory(&hints, sizeof(hints)); 45 | hints.ai_family = AF_INET; 46 | hints.ai_socktype = SOCK_STREAM; 47 | hints.ai_protocol = IPPROTO_TCP; 48 | hints.ai_flags = AI_PASSIVE; 49 | 50 | // Resolve the server address and port 51 | iResult = getaddrinfo(NULL, DEFAULT_PORT, &hints, &result); 52 | if ( iResult != 0 ) { 53 | printf("getaddrinfo failed with error: %d\n", iResult); 54 | WSACleanup(); 55 | return 1; 56 | } 57 | 58 | printf(":: create socket server...\n"); 59 | // Create a SOCKET for connecting to server 60 | ListenSocket = socket(result->ai_family, result->ai_socktype, result->ai_protocol); 61 | if (ListenSocket == INVALID_SOCKET) { 62 | printf("socket failed with error: %ld\n", WSAGetLastError()); 63 | freeaddrinfo(result); 64 | WSACleanup(); 65 | return 1; 66 | } 67 | 68 | // Setup the TCP listening socket 69 | iResult = bind( ListenSocket, result->ai_addr, (int)result->ai_addrlen); 70 | if (iResult == SOCKET_ERROR) { 71 | printf("bind failed with error: %d\n", WSAGetLastError()); 72 | closesocket(ListenSocket); 73 | WSACleanup(); 74 | return 1; 75 | } 76 | 77 | freeaddrinfo(result); 78 | 79 | iResult = listen(ListenSocket, SOMAXCONN); 80 | if (iResult == SOCKET_ERROR) { 81 | printf("listen failed with error: %d\n", WSAGetLastError()); 82 | closesocket(ListenSocket); 83 | WSACleanup(); 84 | return 1; 85 | } 86 | 87 | printf(": socket server created...\n\n"); 88 | 89 | //closesocket(ListenSocket); 90 | 91 | return 0; 92 | } 93 | 94 | bool KinectServer::sendData(int mixedData[], int dataSize){ 95 | iSendResult = send( ClientSocket, (char *) mixedData, dataSize, 0 ); 96 | if (iSendResult == SOCKET_ERROR) { 97 | printf("send failed with error: %d\n", WSAGetLastError()); 98 | closesocket(ClientSocket); 99 | WSACleanup(); 100 | return false; 101 | } 102 | return true; 103 | } 104 | 105 | bool KinectServer::waitForConnection(){ 106 | 107 | printf (":: wait for connection...\n"); 108 | 109 | ClientSocket = accept(ListenSocket, NULL, NULL); 110 | if (ClientSocket == INVALID_SOCKET) { 111 | printf("accept failed with error: %d\n", WSAGetLastError()); 112 | closesocket(ClientSocket); 113 | WSACleanup(); 114 | return false; 115 | } 116 | printf(": client connected...\n\n"); 117 | 118 | return true; 119 | 120 | } 121 | 122 | void KinectServer::closeConnection(){ 123 | // shutdown the connection since we're done 124 | iResult = shutdown(ClientSocket, SD_SEND); 125 | if (iResult == SOCKET_ERROR) { 126 | printf("shutdown failed with error: %d\n", WSAGetLastError()); 127 | closesocket(ClientSocket); 128 | WSACleanup(); 129 | // return 1; 130 | } 131 | 132 | // cleanup 133 | closesocket(ClientSocket); 134 | WSACleanup(); 135 | } 136 | /* 137 | // Accept a client socket 138 | 139 | // No longer need server socket 140 | closesocket(ListenSocket); 141 | */ 142 | -------------------------------------------------------------------------------- /KinectGate/KinectServer.h: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | 3 | #pragma once 4 | 5 | class KinectServer 6 | { 7 | public: 8 | int init(); 9 | int initServer(); 10 | bool waitForConnection(); 11 | void closeConnection(); 12 | bool sendData(int mixedData[], int dataSize); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /KinectGate/ReadMe.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cleoag/KinectGate/95ed4be8c28050d4db2c32c95c041c27ec325d48/KinectGate/ReadMe.txt -------------------------------------------------------------------------------- /KinectGate/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // KinectGate.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /KinectGate/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /KinectGate/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cleoag/KinectGate/95ed4be8c28050d4db2c32c95c041c27ec325d48/README --------------------------------------------------------------------------------