diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2011-04-07 17:44:03 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2011-04-07 17:44:03 +0000 |
commit | 394dca378432d8ba65dd84432ea1a85ddea636fd (patch) | |
tree | 52ab9c5a900e78529f823d40ac0dc6b3b233e072 /FaceTrackNoIR/tracker.cpp | |
parent | b07a116670236fe13262f04d618b11460f4e4b73 (diff) |
PPJoy in DLL
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@65 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FaceTrackNoIR/tracker.cpp')
-rw-r--r-- | FaceTrackNoIR/tracker.cpp | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp index 46b26237..0dd7311e 100644 --- a/FaceTrackNoIR/tracker.cpp +++ b/FaceTrackNoIR/tracker.cpp @@ -183,11 +183,31 @@ QFrame *video_frame; //
switch (selectedClient) {
case FREE_TRACK:
- server_Game = QSharedPointer<FTServer>(new FTServer ( )); // Create Free-track protocol-server
+ server_Game = QSharedPointer<FTNServer>(new FTNServer ( this )); // Create FaceTrackNoIR protocol-server
+
+ //
+ // Load the DLL with the protocol-logic and retrieve a pointer to the Protocol-class.
+ //
+ protocolLib = new QLibrary("FTNoIR_Protocol_FT.dll");
+
+ getProtocol = (importGetProtocol) protocolLib->resolve("GetProtocol");
+ if (getProtocol) {
+ IProtocolPtr ptrXyz(getProtocol());
+ if (ptrXyz)
+ {
+ pProtocol = ptrXyz;
+ pProtocol->Initialize();
+ qDebug() << "Protocol::setup Function Resolved!";
+ }
+ }
+ else {
+ QMessageBox::warning(0,"FaceTrackNoIR Error", "Protocol-DLL not loaded",QMessageBox::Ok,QMessageBox::NoButton);
+ return;
+ }
break;
case FLIGHTGEAR:
- server_Game = QSharedPointer<FTServer>(new FTServer ( )); // Create Free-track protocol-server
+ server_Game = QSharedPointer<FTNServer>(new FTNServer ( this )); // Create FaceTrackNoIR protocol-server
//
// Load the DLL with the protocol-logic and retrieve a pointer to the Protocol-class.
@@ -215,11 +235,31 @@ QFrame *video_frame; break;
case PPJOY:
- server_Game = QSharedPointer<PPJoyServer>(new PPJoyServer ( this )); // Create PPJoy protocol-server
+ server_Game = QSharedPointer<FTNServer>(new FTNServer ( this )); // Create FaceTrackNoIR protocol-server
+
+ //
+ // Load the DLL with the protocol-logic and retrieve a pointer to the Protocol-class.
+ //
+ protocolLib = new QLibrary("FTNoIR_Protocol_PPJOY.dll");
+
+ getProtocol = (importGetProtocol) protocolLib->resolve("GetProtocol");
+ if (getProtocol) {
+ IProtocolPtr ptrXyz(getProtocol());
+ if (ptrXyz)
+ {
+ pProtocol = ptrXyz;
+ pProtocol->Initialize();
+ qDebug() << "Protocol::setup Function Resolved!";
+ }
+ }
+ else {
+ QMessageBox::warning(0,"FaceTrackNoIR Error", "Protocol-installation invalid",QMessageBox::Ok,QMessageBox::NoButton);
+ return;
+ }
break;
case TRACKIR:
- server_Game = QSharedPointer<FTServer>(new FTServer ( )); // Create Free-track protocol-server
+ server_Game = QSharedPointer<FTNServer>(new FTNServer ( this )); // Create FaceTrackNoIR protocol-server
//
// Load the DLL with the protocol-logic and retrieve a pointer to the Protocol-class.
|