shouldn't automatically build a dependency on Windows 7

This commit is contained in:
David Rose 2012-02-22 18:43:56 +00:00
parent 849f276dd8
commit a572d1a413
5 changed files with 37 additions and 24 deletions

View File

@ -425,6 +425,11 @@
// suspect a bug in Panda's memory management code.
#define USE_DELETED_CHAIN 1
// Define this if you are building on Windows 7 or better, and you
// want your Panda build to run only on Windows 7 or better, and you
// need to use the Windows touchinput interfaces.
#define HAVE_WIN_TOUCHINPUT
// Define this true to build the low-level native network
// implementation. Normally this should be set true.
#define WANT_NATIVE_NET 1

View File

@ -717,6 +717,9 @@ $[cdefine __USE_LARGEFILE64]
// To activate the DELETED_CHAIN macros.
$[cdefine USE_DELETED_CHAIN]
// To build the Windows TOUCHINPUT interfaces (requires Windows 7).
$[cdefine HAVE_WIN_TOUCHINPUT]
// If we are to build the native net interfaces.
$[cdefine WANT_NATIVE_NET]

View File

@ -91,7 +91,8 @@ PkgListSet(["PYTHON", "DIRECT", # Python support
"PANDAFX", # Some distortion special lenses
"PANDAPARTICLESYSTEM", # Built in particle system
"CONTRIB", # Experimental
"SSE2" # Compiler features
"SSE2", # Compiler features
"TOUCHINPUT", # Touchinput interface (requires Windows 7)
])
CheckPandaSourceTree()
@ -241,6 +242,16 @@ def parseopts(args):
except:
usage("Invalid setting for OPTIMIZE")
is_win7 = False
if sys.platform.startswith("win"):
if (STRMSPLATFORMVERSION not in ['winserver2003r2', 'win60A']):
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder")
winver = sys.getwindowsversion()
if platsdk and os.path.isdir(platsdk) and winver[0] >= 6 and winver[1] >= 1:
is_win7 = True
if not is_win7:
PkgDisable("TOUCHINPUT")
parseopts(sys.argv[1:])
########################################################################
@ -832,14 +843,9 @@ def CompileCxx(obj,src,opts):
cmd += "/favor:blend "
cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
# Enables Windows 7 mode if SDK is detected.
# But only if it is Windows 7 (0x601) and not e. g. Vista (0x600)
if (STRMSPLATFORMVERSION not in ['winserver2003r2', 'win60A']):
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder")
winver = sys.getwindowsversion()
if platsdk and os.path.isdir(platsdk) and winver[0] >= 6 and winver[1] >= 1:
cmd += "/DPANDA_WIN7 /DWINVER=0x601 "
# Enable Windows 7 interfaces if we need Touchinput.
if PkgSkip("TOUCHINPUT") == 0:
cmd += "/DWINVER=0x601 "
cmd += "/Fo" + obj + " /nologo /c"
if (not is_64 and PkgSkip("SSE2") == 0):
cmd += " /arch:SSE2"
@ -871,14 +877,9 @@ def CompileCxx(obj,src,opts):
cmd += "/favor:blend "
cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
# Enables Windows 7 mode if SDK is detected.
# But only if it is Windows 7 (0x601) and not e. g. Vista (0x600)
if (STRMSPLATFORMVERSION not in ['winserver2003r2', 'win60A']):
platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder")
winver = sys.getwindowsversion()
if platsdk and os.path.isdir(platsdk) and winver[0] >= 6 and winver[1] >= 1:
cmd += "/DPANDA_WIN7 /DWINVER=0x601 "
# Enable Windows 7 interfaces if we need Touchinput.
if PkgSkip("TOUCHINPUT") == 0:
cmd += "/DWINVER=0x601 "
cmd += "/Fo" + obj + " /c"
for x in ipath: cmd += " /I" + x
for (opt,dir) in INCDIRECTORIES:
@ -1612,6 +1613,7 @@ DTOOL_CONFIG=[
("REPORT_OPENSSL_ERRORS", '1', '1'),
("USE_PANDAFILESTREAM", '1', '1'),
("USE_DELETED_CHAIN", '1', '1'),
("HAVE_WIN_TOUCHINPUT", 'UNDEF', 'UNDEF'),
("HAVE_GL", '1', 'UNDEF'),
("HAVE_GLES", 'UNDEF', 'UNDEF'),
("HAVE_GLES2", 'UNDEF', 'UNDEF'),
@ -1836,6 +1838,9 @@ def WriteConfigSettings():
if (PkgSkip("PYTHON") != 0):
dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
if (PkgSkip("TOUCHINPUT") == 0 and sys.platform.startswith("win")):
dtool_config["HAVE_WIN_TOUCHINPUT"] = '1'
if (GetOptimize() <= 3):
dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'

View File

@ -104,7 +104,7 @@ WinGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
_lalt_down = false;
_ralt_down = false;
_hparent = NULL;
#ifdef PANDA_WIN7
#ifdef HAVE_WIN_TOUCHINPUT
_numTouches = 0;
#endif
}
@ -515,7 +515,7 @@ open_window() {
set_focus();
// Register for Win7 touch events.
#ifdef PANDA_WIN7
#ifdef HAVE_WIN_TOUCHINPUT
RegisterTouchWindow(_hWnd, 0);
#endif
@ -2072,7 +2072,7 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
system_changed_properties(properties);
break;
#ifdef PANDA_WIN7
#ifdef HAVE_WIN_TOUCHINPUT
case WM_TOUCH:
_numTouches = LOWORD(wparam);
if(_numTouches > MAX_TOUCHES)
@ -2830,7 +2830,7 @@ bool WinGraphicsWindow::supports_window_procs() const{
////////////////////////////////////////////////////////////////////
bool WinGraphicsWindow::
is_touch_event(GraphicsWindowProcCallbackData* callbackData){
#ifdef PANDA_WIN7
#ifdef HAVE_WIN_TOUCHINPUT
return callbackData->get_msg() == WM_TOUCH;
#else
return false;
@ -2845,7 +2845,7 @@ is_touch_event(GraphicsWindowProcCallbackData* callbackData){
////////////////////////////////////////////////////////////////////
int WinGraphicsWindow::
get_num_touches(){
#ifdef PANDA_WIN7
#ifdef HAVE_WIN_TOUCHINPUT
return _numTouches;
#else
return 0;
@ -2860,7 +2860,7 @@ get_num_touches(){
////////////////////////////////////////////////////////////////////
TouchInfo WinGraphicsWindow::
get_touch_info(int index){
#ifdef PANDA_WIN7
#ifdef HAVE_WIN_TOUCHINPUT
TOUCHINPUT ti = _touches[index];
POINT point;
point.x = TOUCH_COORD_TO_PIXEL(ti.x);

View File

@ -181,7 +181,7 @@ private:
typedef pset<GraphicsWindowProc*> WinProcClasses;
WinProcClasses _window_proc_classes;
#ifdef PANDA_WIN7
#ifdef HAVE_WIN_TOUCHINPUT
UINT _numTouches;
TOUCHINPUT _touches[MAX_TOUCHES];
#endif