about the export to the .pod or .h

This topic contains 5 replies, has 4 voices, and was last updated by  phancuong87 8 years, 7 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #29659

    favormm
    Member

    I know how to export the .max file to .pod or .h file, but  the .h file that I exported is different from the .h file of the demo or TrainingCourse.  The version what i use is 2.02 OGLES-1.1.  I also downloaded the version 2.03,  and find the file is not .h  but .cpp. Now the problem come out , how can I generate the .cpp or .pvr file?

         What I do is export the .h file from 3dmax.  And another question is how to export a image to a .h file.  I can’t fine the guide or training course.  Please me some suggestion.

     

     

    Thanks

     

     

    Ares
    #32559

    warmi
    Member

    For images use PVRTexTool  – it has a mode to export to a C/C++ h style file.

    #32560

    Hello,

     

    The files in our SDK are binary PODs and PVRs which has been converted to .cpp by our FileWrap utility. This utility is used to integrate the binary resources into a single executable. Look at the SDK User Guide for some instructions on how FileWrap operates.

     

    Best regards.

     

    Carlos.
    #32561

    hello all

    I can’t create .cpp file from FileWrap, please tell me the way to create .cpp file from FileWarp step by step. I don’t find how to create cpp file using filewrap in SDK user Guide

    thank!

    phancuong872009-05-20 10:01:10

    #32562

    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.

    #32563

    carlos.sarria, thanks for your help
    I type: filewrap o Memfilesystem.cpp file1 file2 file3 …
     
     

    phancuong872009-05-20 16:25:29

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.