README
Upload User: wmy0603
Upload Date: 2022-05-02
Package Size: 1808k
Code Size: 5k
Development Platform:

Visual C++

  1. Developer's Image Library version 1.7.8 Readme, Notes and Quick Use
  2. -------------------------------------------------------------------
  3. <DZA[afk]> DevIL song: "la la la, a cross-platform image library utilizing a
  4.            simple syntax to load, save, convert, manipulate, filter and display
  5.            a variety of images with ease, la la la"
  6. What is it?
  7. -----------
  8. DevIL is an Open Source image library whose distribution is done under the
  9. terms of the GNU LGPL license. See the COPYING file for more details.
  10. DevIL offers you a simple way to implement loading, manipulating, filtering,
  11. converting, displaying, saving from/to several different image formats in your
  12. own project.
  13. Where can I find it?
  14. --------------------
  15. DevIL can be found at http://openil.sourceforge.net
  16. How do I build and install the 3 libraries ?
  17. -----------------------------------------
  18. *nix    users should read README.unix
  19. VisualC users should read README.win
  20. Cygwin  users should read README.cygwin
  21. MacOSX  users should read README.macosx
  22. PS: *nix stands for GNU/Linux, *BSD, SunOS/Solaris and perhaps some more.
  23.  
  24. More Extensive Documentation
  25. ----------------------------
  26. This file is only a quick guide to point you to more detailed information on
  27. how to use DevIL.  More extensive documentation can currently be found on the
  28. DevIL site at http://openil.sf.net and in the /Docs directory in a normal
  29. install.
  30. Why the hell another image library?
  31. -----------------------------------
  32. I have never seen an image library that can do everything DevIL does.  Sure,
  33. various different libraries can do part of what DevIL can do as well or even
  34. better, but I wanted a simple to use library that encompassed all of these
  35. features.  I also wanted an extremely portable image library that could be used
  36. from a variety of languages and utilized the OpenGL syntax.
  37. Basic Readme
  38. ------------
  39. Most anything stated in this document applies to DevIL as well as DevILU and
  40. DevILUT, unless otherwise stated. (This file is best viewed with word wrap on.)
  41. Errors:
  42. -------
  43. All errors generated inside DevIL, along with illegal parameters passed to
  44. DevIL functions are caught and passed to ilSetError(), an internal library
  45. function.  The calling program can call ilGetError() to get the value of the
  46. error generated.  Error types are defined in il.h, using the 0x501 - 0x5FF
  47. range.  ilGetError() will return 0 (IL_NO_ERROR) if no error has occurred.
  48. Basic Usage:
  49. ------
  50. This demonstrates loading an image through DevIL for OpenGL. Don't forget to 
  51. call ilInit before you before you do anything:
  52. #include <IL/il.h>
  53. #include <IL/ilu.h>
  54. #include <IL/ilut.h>
  55. ...
  56. ILuint devilError;
  57. ilInit();
  58. devilError = ilGetError();
  59. if (devilError != IL_NO_ERROR) {
  60.   printf ("Devil Error (ilInit: %sn", iluGetErrorString (devilError));
  61.   exit (2);
  62. }
  63. ....
  64. ILuint devilID;
  65. ilGenImages(1, &devilID);
  66. ilBindImage(devilID);
  67. ilLoadImage("default1.tga");  // Loads into the current bound image
  68. devilError = ilGetError();
  69. if (devilError != IL_NO_ERROR) {
  70.   printf ("Devil Error (ilLoadImage: %sn", iluGetErrorString (devilError));
  71.   exit (2);
  72. }
  73. ....
  74. ilutRenderer(IL_OPENGL);  // Switch the renderer
  75. ....
  76. GLuint openglID, openglError;
  77. openglID   = ilutGLBindTexImage(); // This generates the texture for you
  78. devilError = ilGetError();
  79. if (devilError != IL_NO_ERROR) {
  80.   printf ("Error: %sn", iluGetErrorString (devilError));
  81.   exit (2);
  82. }
  83. if (openglError != GL_NO_ERROR) {
  84.   printf ("Opengl Error (ilutGLBindTexImage): %sn", gluGetErrorString (openglError));
  85.   exit (2);
  86. }
  87. // Make sure to close the image when you are done with it (though DevIL
  88. // automatically deletes them when the program exits):
  89. glDeleteTextures(1, &openglID);
  90. ilDeleteImages  (1, &devilID);
  91. More Examples:
  92. ---------
  93. The TestIL project is included to test features of DevIL.
  94. DevIL includes a project called GLTest.  This is a simple test of DevIL's
  95. capabilities.  All it does it load any image and displays it in a window
  96. created by FreeGlut, which is available on http://freeglut.sourceforge.net. It
  97. is also included to let the user have an idea of what the library can really
  98. be used for.
  99. Several other test projects are included to test support with various display
  100. APIs.  The WindowsTest project is a basic image program that only runs in
  101. Windows right now but showcases several of DevIL's features through various
  102. menus.
  103. If you want more in-depth tutorials, you can find them on
  104. http://openil.sf.net, or they may be in your installation under the /examples
  105. directory.  Documents are also available in the /docs directory.
  106. Additional Reading
  107. ------------------
  108. All image formats used in DevIL have corresponding documents on
  109. http://www.wotsit.org, under the Graphics Files section.  These documents
  110. proved invaluable for the creation of this library when there was no library
  111. already available for that image format.
  112. Legalese
  113. --------
  114. All contents of this file are intellectual property of Denton Woods,
  115. copyright 2001-2008.