diff --git a/dtool/Config.pp b/dtool/Config.pp index ae149a7510..4745de9606 100644 --- a/dtool/Config.pp +++ b/dtool/Config.pp @@ -153,8 +153,18 @@ // Should we try to build the SGI-specific glxdisplay? #define HAVE_SGIGL -// Should we try to build the DirectX interface? -#define HAVE_DX +// Should we try to build the DirectX interface? What additional +// libraries do we need? +#define DX_IPATH +#define DX_LPATH +#if $[eq $[PLATFORM],Win32] + #define DX_LIBS \ + dxguid.lib winmm.lib kernel32.lib gdi32.lib comdlg32.lib winspool.lib \ + user32.lib advapi32.lib ddraw.lib d3dim.lib +#else + #define DX_LIBS +#endif +#defer HAVE_DX $[libtest $[DX_LPATH],$[DX_LIBS]] // Do you want to build the Renderman interface? #define HAVE_RIB diff --git a/dtool/LocalSetup.pp b/dtool/LocalSetup.pp index 51f9b66170..23bbb1a785 100644 --- a/dtool/LocalSetup.pp +++ b/dtool/LocalSetup.pp @@ -107,6 +107,13 @@ $[define] HAVE_GLUT 1 $[undef] HAVE_GLUT #endif +/* Define if we have DirectX installed and want to build for DX. */ +#if $[HAVE_DX] +$[define] HAVE_DX 1 +#else +$[undef] HAVE_DX +#endif + /* Define if we want to build the Renderman interface. */ #if $[HAVE_RIB] $[define] HAVE_RIB 1 diff --git a/panda/src/dxgsg/Sources.pp b/panda/src/dxgsg/Sources.pp index ffdf0d2544..cc99d81732 100644 --- a/panda/src/dxgsg/Sources.pp +++ b/panda/src/dxgsg/Sources.pp @@ -1,6 +1,7 @@ #define DIRECTORY_IF_DX yes #define OTHER_LIBS interrogatedb:c dconfig:c dtoolutil:c dtoolbase:c dtool:m +#define USE_DX yes #begin lib_target #define TARGET dxgsg diff --git a/panda/src/wdxdisplay/Sources.pp b/panda/src/wdxdisplay/Sources.pp index fcd83ac22c..e26eca001a 100644 --- a/panda/src/wdxdisplay/Sources.pp +++ b/panda/src/wdxdisplay/Sources.pp @@ -1,6 +1,7 @@ #define DIRECTORY_IF_DX yes #define OTHER_LIBS interrogatedb:c dconfig:c dtoolutil:c dtoolbase:c dtool:m +#define USE_DX yes #begin lib_target #define TARGET wdxdisplay