VBreadme.txt 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. Using DevIL from Visual Basic 6.0
  2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3. The idea:
  4. 1) Start by installing the DLLs.
  5. 2) In your VB-project, add the .BAS files that you need as modules.
  6. 3) Just use the subs/functions and constants.
  7. The buts:
  8. 1) DevIL's data types have been converted to native VB-types. This should generally
  9. work alright, except that
  10. a) VB only knows unsigned bytes and signed integers/longs. So sometimes a value is
  11. defined as signed in VB where it is actually unsigned, and vice-versa.
  12. b) DevIL's ILboolean type has been converted to byte. Don't treat these as VB
  13. booleans; only use them to compare to IL_TRUE and IL_FALSE.
  14. 2) Subs/functions that take a pointer to an array as parameter have been declared to
  15. take a ByRef Element As ElementType. You should define an array of ElementType (not
  16. array of variants!), and pass the first element to the function. The function will
  17. then access the whole array.
  18. Example: Dim Names(2) As Long
  19. ilGenImages 3, Names(0) ' Fills all 3 elements of Names
  20. (If you only use a single element, you do not really need an array. You can just
  21. pass a variable of the element type.)
  22. The following subs/functions uses arrays of byte (binary data):
  23. ilCopyPixels (Outputs data. Make sure your array is big enough!)
  24. ilIsValidL
  25. ilLoadL
  26. ilRegisterPal
  27. ilSetPixels
  28. ilTexImage
  29. ilTexImage is a special case, because you might want to pass it a null-pointer
  30. instead of actual data. This cannot be done with the same VB declaration, so I've
  31. made ilTexImage0 for this purpose. Pass ilTexImage0 a zero as the last parameter.
  32. Other functions that operate on arrays:
  33. ilDeleteImages array of long (image "names")
  34. ilGenImages array of long (image "names")
  35. 3) Functions that return pointers have been converted to return a long. But they are
  36. effectively useless in VB. These are:
  37. ilGetData
  38. ilGetPalette
  39. ilGetString
  40. iluErrorString
  41. iluGetString
  42. ilutGetString
  43. ilutGetPaddedData
  44. 4) ilutGetBmpInfo and all ilutD3D8-functions are not available.
  45. 5) You will generally not be able to implement the call-back functions in VB, because
  46. they must be able to handle pointers. But the call-back functions are only used if
  47. you want to modify the way DevIL loads and saves images, and usually you won't need
  48. to do that.
  49. 6) The old VB-examples supplied by Timo Heister don't seem to work. I've yet to write
  50. some new ones.
  51. 7) The VB-headers have only seen minimal testing. Bugs may lure on the unwary.
  52. (I'm especially nervous about iluGetImageInfo).
  53. 8) The header-files are created specificly for VB 6.0. I very much doubt that they will
  54. be of any use in VB.net.
  55. Feel free to send me any comments.
  56. Rune Kock (rune@vupti.com)