beta-0.89.2
[luatex.git] / source / libs / zziplib / zziplib-0.13.62 / docs / README.SDL
blobf0fc66fee24cf8fa9864898bd6110d7d78db50b6
1 WARNING:
2   The following instructions are outdated. 
3   They refer back to 16. Dezember 2002 with zziplib version 0.10.66.
4   Most things refer to MSVC which have a different README 
5     (and there are msvc project files being shipped along)
6   The rest is mainly an example program that you can use as a
7     boilerplate in your souce code - may be just copy and use.
9 ---------------------------------------------------------------------
10 16122002, Thomas.Eder@nmi.at, Using the zziplib library with SDL
13 PREREQUISITES
15   Tested versions:
16     zziplib 0.10.66 (preview), SDL 1.2.5, Win32, MSVC6
18   Homepages (download)
19     zziplib.sourceforge.net (zziplib-0.10.66.tar.gz)
20     www.libsdl.org (SDL-devel-1.2.5a-VC6.zip)
22   Also you have to get zlib, I used 
23     from SDL_image-1.2.2.zip in VisualC.zip:
24       zlib.lib (12.7.1998, 34674 bytes)
25       zlib.h   ( 9.7.1998, 41791 bytes, 1.1.3)
26       zconf.h  ( 8.7.1998,  8089 bytes)
28     from SDL_image-devel-1.2.2-VC6.zip:
29       zlib.dll ( 5.4.2001, 53760 bytes, 1.1.3.1)
31   Maybe you should get the latest version (currently 1.1.4) from
32     http://gnuwin32.sourceforge.net/install.html
33       (see notes at end of page!)
36 CREATING zzlib.dll/zzlib.lib
38   Copy your versions of zlib.lib, zlib.h and zconf.h to the zzlib 
39     directory.
40   In MSVC (start zziplib.dsw)
41     Add zlib.lib to the files for the zziplib_DLL project.
42     Add ZLIB_DLL to the preprocessor definitions.
44   Set the active project and the active configuration to create zziplib.dll 
45   and zziplib.lib (I created and used the release version).
48 USING zzlib WITH SDL
50   Include/add the following files to your SDL-Project
51   (put them in proper directories, etc.):
53   Header files:
54     zconf.h
55     zlib.h
56     zzip.h
57     zzip-conf.h
58     zzip-io.h
59     zziplib.h
60     zzip-msvc.h
61     zzip-stdint.h
63   Libraries:
64     zlib.lib
65     zziplib.lib
67   DLLs:
68     zlib.dll
69     zziplib.dll
71   you may also want to use 
72     SDL_rwops_zzip.c
73     SDL_rwops_zzip.h
76   For compiling it should be sufficient to use
77     #include <zziplib.h> 
78   in the files where you use zziplib-functions.
81 NOTE
83   It is possible to use both original (unzipped) and zipped versions of files,
84   and zziplib will take one of them (depending on the modes when calling 
85   zziplib).
87   But this didnt work for all of my original files, so I suggest using zipped
88   files only (and remove the original unzipped files, so zziplib doesnt try to
89   open the original version).
92 HINT
94   When opening many files from a zip, its faster to open the zip-directory
95   only once, and not for every file access. You may want to modify 
96   SDL_rwops_zzip for this to get code like:
99     SDL_Surface* image;
100     SDL_RWops*   rw;
101     SDL_Surface* temp1 = NULL;  //default > NULL > error
102     SDL_Surface* temp2 = NULL;  //default > NULL > error
104       //last param may be used for err return
105     ZZIP_DIR* zzipdir = zzip_dir_open( "figures.zip", NULL ); 
107     ZZIP_FILE* zfile = zzip_file_open(zzipdir, "f1.bmp", ZZIP_CASELESS);
109     if (zfile)
110     {
111         rw = SDL_RWFromZZIP(zfile);  //modified version
112         if (rw)
113         {
114             temp1 = IMG_Load_RW(rw, 0);
115             SDL_FreeRW(rw);
116         }
117         int zret = zzip_file_close( zfile );
118     }
120     zfile = zzip_file_open(zzipdir, "f2.bmp", ZZIP_CASELESS);
121     if (zfile)
122     {
123         rw = SDL_RWFromZZIP(zfile);  //modified version
124         if (rw)
125         {
126             temp2 = IMG_Load_RW(rw, 0);
127             SDL_FreeRW(rw);
128         }
129         int zret = zzip_file_close( zfile );
130     }
132     //.. etc
134     zzip_dir_close( zzipdir );