Changeset 7264 in orxonox.OLD for branches/shared_lib/src/lib
- Timestamp:
- Apr 2, 2006, 4:51:19 PM (19 years ago)
- Location:
- branches/shared_lib/src/lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/shared_lib/src/lib/BuildLibs.am
r7256 r7264 4 4 $(LIB_PREFIX)/gui/gtk_gui/libORXgui.a \ 5 5 $(LIB_PREFIX)/gui/gl_gui/libORXglgui.a \ 6 $(LIB_PREFIX)/graphics/importer/libORXimporter. a \6 $(LIB_PREFIX)/graphics/importer/libORXimporter.la \ 7 7 $(LIB_PREFIX)/graphics/libORXgraphics.a \ 8 $(LIB_PREFIX)/graphics/importer/libtc.a \9 8 $(LIB_PREFIX)/sound/libORXsound.a \ 10 9 $(LIB_PREFIX)/event/libORXevent.a \ -
branches/shared_lib/src/lib/graphics/Makefile.am
r7165 r7264 4 4 noinst_LIBRARIES = libORXgraphics.a 5 5 6 libORXgraphics_a_SOURCES = graphics_engine.cc \ 7 light.cc \ 8 shader.cc \ 9 \ 10 render2D/render_2d.cc \ 11 render2D/element_2d.cc \ 12 render2D/billboard.cc \ 13 \ 14 text_engine/text_engine.cc \ 15 text_engine/text.cc \ 16 text_engine/font.cc \ 17 \ 18 effects/graphics_effect.cc \ 19 effects/fog_effect.cc \ 20 effects/lense_flare.cc 6 libORXgraphics_a_SOURCES = \ 7 graphics_engine.cc \ 8 light.cc \ 9 shader.cc \ 10 \ 11 render2D/render_2d.cc \ 12 render2D/element_2d.cc \ 13 render2D/billboard.cc \ 14 \ 15 text_engine/text_engine.cc \ 16 text_engine/text.cc \ 17 text_engine/font.cc \ 18 \ 19 effects/graphics_effect.cc \ 20 effects/fog_effect.cc \ 21 effects/lense_flare.cc 21 22 22 23 23 noinst_HEADERS = graphics_engine.h \ 24 light.h \ 25 shader.h \ 26 \ 27 render2D/render_2d.h \ 28 render2D/element_2d.h \ 29 render2D/billboard.h \ 30 \ 31 text_engine/text_engine.h \ 32 text_engine/text.h \ 33 text_engine/font.h \ 34 text_engine/default_font.xpm \ 35 \ 36 effects/graphics_effect.h \ 37 effects/fog_effect.h \ 38 effects/lense_flare.h 24 noinst_HEADERS = \ 25 graphics_engine.h \ 26 light.h \ 27 shader.h \ 28 \ 29 render2D/render_2d.h \ 30 render2D/element_2d.h \ 31 render2D/billboard.h \ 32 \ 33 text_engine/text_engine.h \ 34 text_engine/text.h \ 35 text_engine/font.h \ 36 text_engine/default_font.xpm \ 37 \ 38 effects/graphics_effect.h \ 39 effects/fog_effect.h \ 40 effects/lense_flare.h 39 41 40 42 -
branches/shared_lib/src/lib/graphics/importer/Makefile.am
r6532 r7264 2 2 include $(MAINSRCDIR)/defs/include_paths.am 3 3 4 noinst_LIBRARIES = libORXimporter.a libtc.a4 pkglib_LTLIBRARIES = libORXimporter.la 5 5 6 libORXimporter_a_SOURCES = model.cc \ 7 vertex_array_model.cc \ 8 grid.cc \ 9 static_model.cc \ 10 objModel.cc \ 11 primitive_model.cc \ 12 md2Model.cc \ 13 material.cc \ 14 texture.cc \ 15 texture_sequence.cc \ 16 height_map.cc \ 17 media_container.cc \ 18 movie_player.cc 6 libORXimporter_la_SOURCES = \ 7 model.cc \ 8 tc.cc \ 9 vertex_array_model.cc \ 10 grid.cc \ 11 static_model.cc \ 12 objModel.cc \ 13 primitive_model.cc \ 14 md2Model.cc \ 15 material.cc \ 16 texture.cc \ 17 texture_sequence.cc \ 18 height_map.cc \ 19 media_container.cc \ 20 movie_player.cc 19 21 20 libtc_a_SOURCES = tc.cc 21 22 23 noinst_HEADERS = model.h \ 24 tc.h \ 25 vertex_array_model.h \ 26 grid.h \ 27 static_model.h \ 28 objModel.h \ 29 primitive_model.h \ 30 md2Model.h \ 31 material.h \ 32 texture.h \ 33 texture_sequence.h \ 34 height_map.h \ 35 anorms.h \ 36 anormtab.h \ 37 media_container.h \ 38 movie_player.h 22 noinst_HEADERS = \ 23 model.h \ 24 tc.h \ 25 vertex_array_model.h \ 26 grid.h \ 27 static_model.h \ 28 objModel.h \ 29 primitive_model.h \ 30 md2Model.h \ 31 material.h \ 32 texture.h \ 33 texture_sequence.h \ 34 height_map.h \ 35 anorms.h \ 36 anormtab.h \ 37 media_container.h \ 38 movie_player.h -
branches/shared_lib/src/lib/util/loading/dynamic_loader.cc
r7167 r7264 17 17 18 18 #include "dynamic_loader.h" 19 20 21 #include <dlfcn.h> 22 19 #include "resource_manager.h" 23 20 24 21 using namespace std; 25 26 22 27 23 /** … … 30 26 */ 31 27 DynamicLoader::DynamicLoader (const std::string& libName) 32 : Factory(NULL, CL_NULL)33 28 { 34 29 this->setClassID(CL_DYNAMIC_LOADER, "DynamicLoader"); … … 40 35 } 41 36 37 /** 38 * @brief initializes the Dynamic Library loader 39 * @returns true on succes, false otherwise 40 */ 41 bool DynamicLoader::initialize() 42 { 43 if (lt_dlinit () != 0) 44 { 45 PRINTF(1)("Initializing LT_DL_LIB: %s\n", lt_dlerror()); 46 return false; 47 } 48 else 49 return true; 50 } 42 51 43 52 /** … … 48 57 // delete what has to be deleted here 49 58 if (this->handle != NULL) 50 dlclose(this->handle);59 lt_dlclose(this->handle); 51 60 } 52 61 … … 54 63 bool DynamicLoader::loadDynamicLib(const std::string& libName) 55 64 { 56 this->handle = dlopen(&libName[0], RTLD_NOW); 65 DynamicLoader::initialize(); 66 67 this->handle = lt_dlopen(&libName[0]); 57 68 if(this->handle == NULL) 58 69 { 59 70 return false; 60 71 } 61 void *mkr = dlsym( this->handle, "maker");62 72 } 63 73 64 74 bool DynamicLoader::loadDyLib(const std::string& libName) 65 75 { 76 DynamicLoader::initialize(); 77 66 78 void* handle; 67 handle = dlopen(&libName[0], RTLD_NOW);79 handle = lt_dlopen(libName.c_str()); 68 80 if(handle == NULL) 69 81 { 70 PRINTF(0)("unable to load %s\n", &libName[0]); 82 PRINTF(1)("unable to load %s: %s\n", libName.c_str(), lt_dlerror()); 83 71 84 return false; 72 85 } 73 // void *mkr = dlsym("maker"); 86 87 } 88 89 void DynamicLoader::addSearchDir(const std::string& searchDir) 90 { 91 DynamicLoader::initialize(); 92 93 lt_dladdsearchdir(searchDir.c_str()); 94 } 95 96 /** 97 * @param relSearchDir: the Relative directory to add to searchPath of lt_dl 98 * @returns true if the Path was Valid, false otherwise 99 */ 100 bool DynamicLoader::addSearchDirRelative(const std::string& relSearchDir) 101 { 102 std::string absSearchDir = ResourceManager::getAbsDir(relSearchDir); 103 if (ResourceManager::isDir(absSearchDir)) 104 { 105 DynamicLoader::addSearchDir(absSearchDir); 106 return true; 107 } 108 else 109 { 110 return false; 111 } 112 } 113 114 bool DynamicLoader::addSearchDirInLibDir(const std::string& relSearchDir) 115 { 74 116 75 117 } 76 118 77 119 78 BaseObject* DynamicLoader::fabricateObject(const TiXmlElement* root) const 120 const char* DynamicLoader::getSearchDir() 79 121 { 122 return lt_dlgetsearchpath(); 80 123 } -
branches/shared_lib/src/lib/util/loading/dynamic_loader.h
r7193 r7264 8 8 9 9 #include "util/loading/factory.h" 10 #include <ltdl.h> 10 11 11 12 #include <string> 12 13 #define DYNAMIC_LINKAGE_FACTORY(CLASS_NAME, CLASS_ID) \14 void* DynamicCreator(const TiXmlElement* root) { return new CLASS_NAME(root); };15 13 16 14 // FORWARD DECLARATION 17 15 18 16 //! A class for ... 19 class DynamicLoader : public Factory17 class DynamicLoader : public BaseObject 20 18 { 21 19 … … 25 23 26 24 bool loadDynamicLib(const std::string& libName); 27 virtual BaseObject* fabricateObject(const TiXmlElement* root = NULL) const;28 25 29 26 static bool loadDyLib(const std::string& libName); 30 27 28 static void addSearchDir(const std::string& searchDir); 29 static bool addSearchDirRelative(const std::string& relSearchDir); 30 static bool addSearchDirInLibDir(const std::string& relSearchDir); 31 static const char* getSearchDir(); 32 33 static void unload(); 34 private: 35 // will be done automatically when using the this Engine. 36 static bool initialize(); 31 37 32 38 private: 33 void*handle;39 lt_dlhandle handle; 34 40 }; 35 41 -
branches/shared_lib/src/lib/util/loading/resource_manager.cc
r7225 r7264 881 881 882 882 883 884 883 885 /** 884 886 * @param fileName the Name of the File to check … … 921 923 return ResourceManager::getInstance()->_cwd; 922 924 } 923 924 925 925 926 /**
Note: See TracChangeset
for help on using the changeset viewer.