Imlib 2 is the successor to Imlib. It is NOT a newer version - it is a completely new library. Imlib 2 can be installed alongside Imlib 1.x without any problems since they are effectively different libraries - BUT they Have very similar functionality.
Imlib 2 does the following:
@ -61,7 +52,10 @@ the loaders directory with the others and all Imlib2 programs will
automatically be able to use it - without a restart).
@ -174,15 +167,16 @@ Sometimes loading images can take a while. Often it is a good idea to provide fe
@section second_ex A more advanced Example
This is a more comprehensive example that should show off a fair number of features of imlib2. The code this was based off can be found in Imlib2's test directory. This covers a lot of the core of Imlib2's API so you should have a pretty good idea on how it works if you understand this code snippet.
This is a more comprehensive example that should show off a fair number of features of imlib2.
It covers a lot of the core of Imlib2's API so you should have a pretty good idea on how it works if you understand this code snippet.
@note
This program should work when run at the top of the imlib2 source tree. If run elsewhere paths to fonts and images may have to be adjusted.
@code
/* include X11 stuff */
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
/* include Imlib2 stuff */
#include <Imlib2.h>
/* sprintf include */
#include <stdio.h>
/* some globals for our window & X display */
Display *disp;
@ -227,9 +221,9 @@ int main(int argc, char **argv)
imlib_set_cache_size(2048 * 1024);
/* set the font cache to 512Kb - again to avoid re-loading */
imlib_set_font_cache_size(512 * 1024);
/* add the ./ttfonts dir to our font path - you'll want a notepad.ttf */
/* add the ./data/fonts dir to our font path - you'll want a notepad.ttf */
/* in that dir for the text to display */
imlib_add_path_to_font_path("./ttfonts");
imlib_add_path_to_font_path("./data/fonts");
/* set the maximum number of colors to allocate for 8bpp and less to 128 */
imlib_set_color_usage(128);
/* dither for depths < 24bpp */
@ -269,7 +263,7 @@ int main(int argc, char **argv)
case MotionNotify:
/* if the mouse moves - note it */
/* add a rectangle update for the new mouse position */