From 77d2c851e6109ac5a0e56c1f411b05e5b3c05587 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 6 May 2008 19:52:31 +0000 Subject: [PATCH] explicit tinydisplay controls --- dtool/Config.pp | 12 ++++++++--- dtool/LocalSetup.pp | 21 +++++++++++++++++++ panda/src/tinydisplay/Sources.pp | 2 +- panda/src/tinydisplay/config_tinydisplay.cxx | 2 ++ panda/src/tinydisplay/tinySDLGraphicsPipe.cxx | 6 ++++++ panda/src/tinydisplay/tinySDLGraphicsPipe.h | 5 +++++ .../src/tinydisplay/tinySDLGraphicsWindow.cxx | 6 ++++++ panda/src/tinydisplay/tinySDLGraphicsWindow.h | 4 ++++ 8 files changed, 54 insertions(+), 4 deletions(-) diff --git a/dtool/Config.pp b/dtool/Config.pp index f07027172a..4f731343ad 100644 --- a/dtool/Config.pp +++ b/dtool/Config.pp @@ -616,9 +616,15 @@ // Similar to MIN_GL_VERSION, above. #define MIN_MESA_VERSION 1 1 -// We are experimenting with integrating TinyGL for fast but cheesy -// software rendering. Presently, this requires SDL for window -// management. +// Do you want to build tinydisplay, a cheesy software renderer built +// into Panda, based on TinyGL? On some platforms, this presently +// requires SDL for window management. +#define HAVE_TINYDISPLAY + +// The SDL library is at the moment required only for support of +// tinydisplay. It may not even be required for that, as we are in +// the process of porting tinydisplay to direct OS-native window +// creation. #define SDL_IPATH #define SDL_LPATH #define SDL_LIBS SDL diff --git a/dtool/LocalSetup.pp b/dtool/LocalSetup.pp index 2265ae0ec0..ce1eff1f81 100644 --- a/dtool/LocalSetup.pp +++ b/dtool/LocalSetup.pp @@ -116,6 +116,21 @@ #else #print - Did not find DirectX9 #endif +#if $[HAVE_TINYDISPLAY] +#print + Tinydisplay +#else +#print - Not building Tinydisplay +#endif +#if $[HAVE_SDL] +#print + SDL +#else +#print - Did not find SDL +#endif +#if $[HAVE_MESA] +#print + Mesa +#else +#print - Did not find Mesa +#endif #if $[HAVE_OPENCV] #print + OpenCV #else @@ -281,6 +296,12 @@ $[cdefine HAVE_DX8] /* Define if we have DirectX installed and want to build for DX. */ $[cdefine HAVE_DX9] +/* Define if we want to build tinydisplay. */ +$[cdefine HAVE_TINYDISPLAY] + +/* Define if we have the SDL library. */ +$[cdefine HAVE_SDL] + /* Define if we have Chromium installed and want to use it. */ $[cdefine HAVE_CHROMIUM] diff --git a/panda/src/tinydisplay/Sources.pp b/panda/src/tinydisplay/Sources.pp index 4de1a03e43..5e43cf0590 100644 --- a/panda/src/tinydisplay/Sources.pp +++ b/panda/src/tinydisplay/Sources.pp @@ -1,4 +1,4 @@ -#define BUILD_DIRECTORY $[HAVE_SDL] +#define BUILD_DIRECTORY $[HAVE_TINYDISPLAY] #define BUILDING_DLL BUILDING_TINYDISPLAY #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \ diff --git a/panda/src/tinydisplay/config_tinydisplay.cxx b/panda/src/tinydisplay/config_tinydisplay.cxx index 7e3fae5d1d..b8c40d5f0a 100644 --- a/panda/src/tinydisplay/config_tinydisplay.cxx +++ b/panda/src/tinydisplay/config_tinydisplay.cxx @@ -97,10 +97,12 @@ init_libtinydisplay() { TinyXGraphicsPipe::pipe_constructor); #endif +#ifdef HAVE_SDL TinySDLGraphicsPipe::init_type(); TinySDLGraphicsWindow::init_type(); selection->add_pipe_type(TinySDLGraphicsPipe::get_class_type(), TinySDLGraphicsPipe::pipe_constructor); +#endif PandaSystem *ps = PandaSystem::get_global_ptr(); ps->add_system("TinyGL"); diff --git a/panda/src/tinydisplay/tinySDLGraphicsPipe.cxx b/panda/src/tinydisplay/tinySDLGraphicsPipe.cxx index 151606333c..6ad3c70547 100644 --- a/panda/src/tinydisplay/tinySDLGraphicsPipe.cxx +++ b/panda/src/tinydisplay/tinySDLGraphicsPipe.cxx @@ -16,6 +16,10 @@ // //////////////////////////////////////////////////////////////////// +#include "pandabase.h" + +#ifdef HAVE_SDL + #include "tinySDLGraphicsPipe.h" #include "tinySDLGraphicsWindow.h" #include "tinyGraphicsStateGuardian.h" @@ -123,3 +127,5 @@ make_output(const string &name, // Nothing else left to try. return NULL; } + +#endif // HAVE_SDL diff --git a/panda/src/tinydisplay/tinySDLGraphicsPipe.h b/panda/src/tinydisplay/tinySDLGraphicsPipe.h index c5ea618a35..1a26e96730 100644 --- a/panda/src/tinydisplay/tinySDLGraphicsPipe.h +++ b/panda/src/tinydisplay/tinySDLGraphicsPipe.h @@ -20,6 +20,9 @@ #define TINYSDLGRAPHICSPIPE_H #include "pandabase.h" + +#ifdef HAVE_SDL + #include "graphicsWindow.h" #include "graphicsPipe.h" @@ -68,4 +71,6 @@ private: #include "tinySDLGraphicsPipe.I" +#endif // HAVE_SDL + #endif diff --git a/panda/src/tinydisplay/tinySDLGraphicsWindow.cxx b/panda/src/tinydisplay/tinySDLGraphicsWindow.cxx index 182253cdbc..98cbe962a6 100644 --- a/panda/src/tinydisplay/tinySDLGraphicsWindow.cxx +++ b/panda/src/tinydisplay/tinySDLGraphicsWindow.cxx @@ -16,6 +16,10 @@ // //////////////////////////////////////////////////////////////////// +#include "pandabase.h" + +#ifdef HAVE_SDL + #include "tinySDLGraphicsWindow.h" #include "tinyGraphicsStateGuardian.h" #include "config_tinydisplay.h" @@ -529,3 +533,5 @@ get_mouse_button(Uint8 button) { return ButtonHandle::none(); } + +#endif // HAVE_SDL diff --git a/panda/src/tinydisplay/tinySDLGraphicsWindow.h b/panda/src/tinydisplay/tinySDLGraphicsWindow.h index 844241c808..491b6f2476 100644 --- a/panda/src/tinydisplay/tinySDLGraphicsWindow.h +++ b/panda/src/tinydisplay/tinySDLGraphicsWindow.h @@ -21,6 +21,8 @@ #include "pandabase.h" +#ifdef HAVE_SDL + #include "tinySDLGraphicsPipe.h" #include "graphicsWindow.h" #include "buttonHandle.h" @@ -84,4 +86,6 @@ private: #include "tinySDLGraphicsWindow.I" +#endif // HAVE_SDL + #endif