Improved the set up of static build, added freetype plugin to plugins that support static usage

This commit is contained in:
Robert Osfield
2007-06-10 09:51:29 +00:00
parent 7ce05f6d9d
commit b48ed1a4d4
6 changed files with 54 additions and 37 deletions

View File

@@ -22,6 +22,11 @@
#include <osgViewer/Export>
extern "C"
{
typedef void (* CGraphicsWindowFunction) (void);
}
namespace osgViewer {
/** Base class for providing Windowing API agnostic access to creating and managing graphisc window and events.
@@ -204,6 +209,23 @@ class GraphicsWindowEmbedded : public GraphicsWindow
virtual void grabFocusIfPointerInWindow() {}
};
struct GrapicsWindowFunctionProxy
{
GrapicsWindowFunctionProxy(CGraphicsWindowFunction function) { (function)(); }
};
#define USE_GRAPICSWINDOW_IMPLEMENTATION(ext) \
extern "C" void graphicswindow_##ext(void); \
static osgViewer::GrapicsWindowFunctionProxy graphicswindowproxy_##ext(graphicswindow_##ext);
#if defined(_WIN32)
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Win32)
#elif defined(__APPLE__)
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Carbon)
#else
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(X11)
#endif
}
#endif