From fd50d41ef50c1f93921d2466449e53f0b4767e7c Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 18 Apr 2003 01:36:15 +0000 Subject: Patch from Simon for portable DLL loading. --- include/Platform.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/Platform.h') diff --git a/include/Platform.h b/include/Platform.h index db3cd6c7d..63c9514e8 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -52,6 +52,7 @@ typedef void *SurfaceID; typedef void *WindowID; typedef void *MenuID; typedef void *TickerID; +typedef void *Function; /** * A geometric point class. @@ -428,6 +429,23 @@ public: double Duration(bool reset=false); }; +/** + * Dynamic Library (DLL/SO/...) loading + */ +class DynamicLibrary { +public: + virtual ~DynamicLibrary() {}; + + /// @return Pointer to function "name", or NULL on failure. + virtual Function *FindFunction(const char *name) = 0; + + /// @return true if the library was loaded successfully. + virtual bool IsValid() = 0; + + /// @return An instance of a DynamicLibrary subclass with "modulePath" loaded. + static DynamicLibrary *Load(const char *modulePath); +}; + /** * Platform class used to retrieve system wide parameters such as double click speed * and chrome colour. Not a creatable object, more of a module with several functions. -- cgit v1.2.3