home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3194 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: comma.rhein.de!serpens!not-for-mail
  2. From: mlelstv@serpens.rhein.de (Michael van Elst)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Demo/game to OS friendly part II
  5. Date: 8 Feb 1996 11:41:43 +0100
  6. Organization: dis-
  7. Message-ID: <4fck17$3v1@serpens.rhein.de>
  8. References: <3118bf29@gauss.demon.co.uk>
  9. NNTP-Posting-Host: serpens.rhein.de
  10.  
  11. Andrew Bennett <ben@gauss.demon.co.uk> writes:
  12.  
  13. > What exactly does InitBitmap() do ??
  14.  
  15. It initializes a bitmap structure according to the values you pass to it.
  16.  
  17. _Currently_ that means that it just pokes the values into the structure
  18. and clears unused fields.
  19.  
  20. > I simply allocate the correct amount of chipmem using AllocMem,calculate the
  21. >bitplane addresses then bung them into a BitMap structure.
  22.  
  23. That's what you still have to do.
  24.  
  25. > Then I open an intuition screen with a custom bitmap. Is there anything
  26. >"wrong" with this method ? Is this liable to fail in a future OS ?
  27.  
  28. Oh, this already fails with the current OS if you happen to have AGA.
  29.  
  30. There are two legal methods to generate a bitmap:
  31.  
  32.     struct BitMap BM;
  33.  
  34.     InitBitMap(&BM, depth, width, height);
  35.     for (i=0; i<depth; ++i)
  36.         BM.Planes[i] = some_chip_mem;
  37.  
  38. and
  39.  
  40.     struct BitMap *bm;
  41.  
  42.     bm = AllocBitMap(width, height, depth, flags, friend_bitmap);
  43.  
  44. The first kind of bitmap is sufficient for any rendering operation but might be slower
  45. than necessary. It does not necessarily work for a display bitmap and it doesn't
  46. support interleaved bitmaps. It is also limited to eight bitplanes.
  47.  
  48. The second kind of bitmap can be used for display and you might pass a pointer to another
  49. bitmap so that blits between both maps are as efficient as possible. This kind of bitmap
  50. can be of arbitrary structure and you must not access any fields in the structure. You
  51. can use the GetBitMapAttr() function to query some attributes. One attribute is a flag
  52. that tells you wether the bitmap is "standard". If it is "standard" then bm points to a standard
  53. BitMap structure with valid Plane pointers.
  54.  
  55. Regards,
  56. -- 
  57.                                 Michael van Elst
  58.  
  59. Internet: mlelstv@serpens.rhein.de
  60.                                 "A potential Snark may lurk in every tree."
  61.