Hello,
Yes, you are right. I have checked it and by mistake this section is not in our User Guide for OpenGL ES 1.1 although it is in the OpenGLES 2.0 one. We will fix this problem. In the meant time I have copied below the section that should have been in the document.
Regards.
Carlos.
Memory File System and FileWrap
All file read access in the PVRTools library uses the CPVRTResourceFile class. This not only simplifies code, it also allows the use of a "memory file system". Any file can be statically linked into the application and looked up by name at run time. This is useful for platforms without a file system and keeps all the required data in one place, the application executable.
When looking for a file, CPVRTResourceFile will first look in the read path the application set by calling CPVRTResourceFile::SetReadPath. This is usually a platform dependent path which can be obtained from PVRShell. If the file is not there, CPVRTResourceFile will look for the file in the memory file system. This way "internal" files linked in the executable can be overridden by external ones. When using the memory file system filenames passed to PVRTools, functions should always be given without a path.
Using the Memory File System in your own Projects
In order to use the memory file system in your own projects, you need to link to the PVRTools library. Furthermore, you need to turn the files you want to add into C++ sources using the Filewrap utility. Typically this would be done with a command line like this:
filewrap –o Memfilesystem.cpp file1 file2 file3 ...
Note that the name of the .cpp file is not important; the files will be registered in the memory file system under their original name (in this case file1, file2, file3). You can also generate multiple .cpp files and compile them into the same application. However, the memory file system is just a list of files without any directory structure, so make sure not to use duplicate file names within an application.
After you have generated the .cpp files, all you need to do is add them to your project like you would add other C++ source files. Now you are ready to use CPVRTResourceFile to read files from the memory file system. Of course this wrapping can also be automated using makefiles or custom build steps in Visual Studio projects.
To automate Filewrap using custom build steps in Visual Studio, first add the file you want in the memory file system to your project ("Add existing item…"). Then select this file in the Solution Explorer and open the property page for it. Choose "All Configurations", and then select "Custom Build Step".
Set "Command Line" to:
Filewrap.exe -o "$(InputDir)Outputfile.cpp" "$(InputPath)"
Set "Outputs" to:
$(InputDir)Outputfile.cpp
Make sure Filewrap.exe is on your PATH environment variable or use an absolute path to Filewrap.exe. Replace Outputfile.cpp with a file name of your choice.
Following this, close the property page, right-click on the file and select "Compile". This should produce the .cpp file which you should also add to your project.