您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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