mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-18 22:23:48 +00:00
Razer Hydra integration
This commit is contained in:
parent
965336d54d
commit
0b4c3f1e42
12 changed files with 2195 additions and 0 deletions
75
Tools/projectGenerator/modules/razerHydra.inc
Normal file
75
Tools/projectGenerator/modules/razerHydra.inc
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
beginModule( 'razerHydra' );
|
||||
|
||||
// Look for the optional global from the project.conf.
|
||||
global $RAZERHYDRA_SDK_PATH;
|
||||
if (!$RAZERHYDRA_SDK_PATH)
|
||||
{
|
||||
// First look for an environment var.
|
||||
$RAZERHYDRA_SDK_PATH = getenv( "TORQUE_RAZERHYDRA_PATH" );
|
||||
|
||||
if (strlen($RAZERHYDRA_SDK_PATH) == 0 || !file_exists($RAZERHYDRA_SDK_PATH))
|
||||
{
|
||||
// Sometimes users get confused and use this var.
|
||||
$RAZERHYDRA_SDK_PATH = getenv( "RAZERHYDRA_SDK_PATH" );
|
||||
}
|
||||
|
||||
// We need forward slashes for paths.
|
||||
$RAZERHYDRA_SDK_PATH = str_replace( "\\", "/", $RAZERHYDRA_SDK_PATH);
|
||||
|
||||
// Remove trailing slashes.
|
||||
$RAZERHYDRA_SDK_PATH = rtrim($RAZERHYDRA_SDK_PATH, " /");
|
||||
}
|
||||
|
||||
// If we still don't have the SDK path then let the user know.
|
||||
if (!file_exists($RAZERHYDRA_SDK_PATH))
|
||||
{
|
||||
trigger_error(
|
||||
"\n*******************************************************************".
|
||||
"\n".
|
||||
"\n We were not able to find a valid path to the Razer Hydra SDK!".
|
||||
"\n".
|
||||
"\n You must install the latest Sixense SDK and set the path via a".
|
||||
"\n \$RAZERHYDRA_SDK_PATH variable in your buildFiles/project.conf file".
|
||||
"\n or by setting the TORQUE_RAZERHYDRA_PATH system environment variable".
|
||||
"\n (may require a reboot).".
|
||||
"\n".
|
||||
"\n*******************************************************************".
|
||||
"\n", E_USER_ERROR );
|
||||
}
|
||||
|
||||
// Only Windows is supported at this time
|
||||
if ( Generator::$platform == "win32" )
|
||||
{
|
||||
// Source
|
||||
addEngineSrcDir( "platform/input/razerHydra" );
|
||||
|
||||
// Includes
|
||||
addIncludePath( $RAZERHYDRA_SDK_PATH . "/include" );
|
||||
}
|
||||
|
||||
endModule();
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue