Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef LoadWriterVLX_INCLUDE_ONCE
00033 #define LoadWriterVLX_INCLUDE_ONCE
00034
00035 #include <vlCore/VLXClassWrapper.hpp>
00036 #include <vlCore/VLXRegistry.hpp>
00037 #include <vlCore/VLXSerializer.hpp>
00038 #include <vlCore/VLXValue.hpp>
00039 #include <vlCore/vlxutils.hpp>
00040 #include <vlCore/LoadWriterManager.hpp>
00041 #include <vlGraphics/Actor.hpp>
00042 #include <vlGraphics/Effect.hpp>
00043 #include <vlGraphics/Shader.hpp>
00044 #include <vlGraphics/Geometry.hpp>
00045 #include <vlGraphics/Light.hpp>
00046 #include <vlGraphics/ClipPlane.hpp>
00047 #include <vlGraphics/Camera.hpp>
00048 #include <vlGraphics/DrawElements.hpp>
00049 #include <vlGraphics/MultiDrawElements.hpp>
00050 #include <vlGraphics/DrawArrays.hpp>
00051 #include <vlGraphics/SceneManagerActorTree.hpp>
00052 #include <vlGraphics/DistanceLODEvaluator.hpp>
00053 #include <vlGraphics/PixelLODEvaluator.hpp>
00054 #include <vlGraphics/DepthSortCallback.hpp>
00055 #include <vlGraphics/GLSL.hpp>
00056 #include <vlCore/ResourceDatabase.hpp>
00057 #include <vlCore/DiskFile.hpp>
00058
00059 namespace vl
00060 {
00061
00062
00063 VLGRAPHICS_EXPORT ref<ResourceDatabase> loadVLT(VirtualFile* file);
00064 VLGRAPHICS_EXPORT ref<ResourceDatabase> loadVLT(const String& path);
00065 VLGRAPHICS_EXPORT ref<ResourceDatabase> loadVLB(VirtualFile* file);
00066 VLGRAPHICS_EXPORT ref<ResourceDatabase> loadVLB(const String& path);
00067 VLGRAPHICS_EXPORT bool saveVLT(VirtualFile* file, const ResourceDatabase*);
00068 VLGRAPHICS_EXPORT bool saveVLT(const String& file, const ResourceDatabase*);
00069 VLGRAPHICS_EXPORT bool saveVLB(VirtualFile* file, const ResourceDatabase*);
00070 VLGRAPHICS_EXPORT bool saveVLB(const String& file, const ResourceDatabase*);
00071 VLGRAPHICS_EXPORT bool isVLT(VirtualFile* file);
00072 VLGRAPHICS_EXPORT bool isVLT(const String& file);
00073 VLGRAPHICS_EXPORT bool isVLB(VirtualFile* file);
00074 VLGRAPHICS_EXPORT bool isVLB(const String& file);
00075
00076
00077
00078
00082 class LoadWriterVLX: public ResourceLoadWriter
00083 {
00084 VL_INSTRUMENT_CLASS(vl::LoadWriterVLX, ResourceLoadWriter)
00085
00086 public:
00087 LoadWriterVLX(): ResourceLoadWriter("|vlt|vlb|", "|vlt|vlb|") {}
00088
00089 ref<ResourceDatabase> loadResource(const String& path) const
00090 {
00091 if (isVLT(path))
00092 return loadVLT(path);
00093 else
00094 if (isVLB(path))
00095 return loadVLB(path);
00096 else
00097 return NULL;
00098 }
00099
00100 ref<ResourceDatabase> loadResource(VirtualFile* file) const
00101 {
00102 if (isVLT(file))
00103 return loadVLT(file);
00104 else
00105 if (isVLB(file))
00106 return loadVLB(file);
00107 else
00108 return NULL;
00109 }
00110
00111 bool writeResource(const String& path, ResourceDatabase* res_db) const
00112 {
00113 if (path.extractFileExtension().toLowerCase() == "vlt")
00114 return saveVLT(path, res_db);
00115 else
00116 if (path.extractFileExtension().toLowerCase() == "vlb")
00117 return saveVLB(path, res_db);
00118 else
00119 return false;
00120 }
00121
00122 bool writeResource(VirtualFile* file, ResourceDatabase* res_db) const
00123 {
00124 if (file->path().extractFileExtension().toLowerCase() == "vlt")
00125 return saveVLT(file, res_db);
00126 else
00127 if (file->path().extractFileExtension().toLowerCase() == "vlb")
00128 return saveVLB(file, res_db);
00129 else
00130 return false;
00131 }
00132 };
00133
00134 }
00135
00136 #endif