Hello
Is there any sample code showing how to use the the GapiDraw virtual file system.
thanks
Hi,
I tried to use GapiVFS a few weeks ago and found it quite easy to use.
Here's the code I'm using (there may be a better way, but it works):
VFS_File = new CGapiVFS();
VFS_File->CreateVFS(tcFile);
//tcFile is the absolute path to your VFS file.
//Then to load an image from the VFS:
pSurface->CreateSurface(GDSURFACE_SYSTEMMEMORY,VFS_File,TEXT("/file.jpg"));
So you see it is quite simple!
I think I posted a thread about it few weeks ago, I was wondering how to use VFS to store wav file and then read them. You might find it usefull. Search for threads that contain "VFS sound" in the GapiDraw forum.
Some more info that are quite important and can avoid some time wondering why it doesn't work:
- don't forget the "/" before the name of your file when you're loading it (it's written in the doc)
- It appears that VFS is case sensitive, so if you store a file called "File.jpg" and try to load a "file.jpg", it won't work.
Hope this helps.
Vincent.
I have a few questions about VFS:
- Is there any way to loop through all of the files without knowing the file names? This way you can, for example, loop through the VFS and load anything with extension .png or .wav, etc.
- Can you store additional info. with images, sounds, etc.? Each of my images requires additional information to use, such as frame width and height.
Being able to enumerate files in a given directory inside a VFS would be awesome. I'm not sure if you can do this now, but it'd be a welcome addition if you can't.
Johan, is this possible?