leibow@video.dec.com (MICHAEL LEIBOW) (08/14/88)
Hi, I asked how to scroll a superbitmap window last week, and got some good answers. Most of the people told me to look at different demos that are on Fred Fish disks. Others told me to look at books on the subject. Since it was easier for me to look at a book then find a FF disk, I decided to waste 20 bucks and buy Rob Peck's book, "Programmers guide to the Amiga." My comments: I was looking for a way to change which part of the bitmap in a superbitmap window is visible. I was expecting a "window" routine to do this, but found that I have to use a lower level layer routine. I don't think it is a good idea to have to mess with fields of the window structure. Having to use the layers library to manipulate windows is like going into the intuition base and changing the FirstWindow list in order to reorganize the way the windows are stacked. I wish the people at Commodore would add some more useful high level routines to the intuition library instead of making us go "behind the window's back" and use the layers library. Another example of this is making a clipping region. Comments on Peck's book: I read most of the book last night and believe that the book is a good introduction to Amiga programming. It is probably in execellent way to go before trying to understand the RKM's. BUT, disreguarding the book's good layout, There are just as many mistakes in the examples as there is in the RKM's. I don't have my book next to me at the moment so I can't make too many specific examples, but I do remember: One of the programs had a NewWindow structure with fields missing. Another section on IDCMP events said that MOUSEBUTTONS events would have higher precedence than GADGETUP or GADGETDOWN events and that gadgets in windows won't work if you have the IDCMP sending MOUSEBUTTONS events. Then, on the following page, there is an example with both GADGETUP and MOUSEBUTTONS set in the IDCMPFlags field of the NewWIndow structure. This would probably confuse any programmer who hasn't written any Amiga programs. In the first chapter, there was an example that used a fprintf() with the first paramater being an AmigaDos filehandle and not a lattice or manx file pointer. So, if you want to learn how to program the amiga, I do suggest this book because it is easy to read, but I suggest you be very careful when typing in any of the examples. Go over the examples with a fine toothed comb before compiling them. If you have a lint preprocessor, you should use it on the examples to make sure they won't bomb out. A last thing to be careful about is the disreguard to pointer and integer types. Peck mixes pointers and integers in almose every example. This kind of programming will not work if you use 16 bit integers (the default for Aztec C). --Mike Leibow
dale@boing.UUCP (Dale Luck) (08/14/88)
In article <8808132305.AA13416@decwrl.dec.com> leibow@video.dec.com (MICHAEL LEIBOW) writes: >Hi, > > >My comments: > I was looking for a way to change which part of the bitmap in >a superbitmap window is visible. I was expecting a "window" routine to >do this, but found that I have to use a lower level layer routine. I don't >think it is a good idea to have to mess with fields of the window structure. >Having to use the layers library to manipulate windows is like going into >the intuition base and changing the FirstWindow list in order to reorganize >the way the windows are stacked. I wish the people at Commodore would add >some more useful high level routines to the intuition library instead of >making us go "behind the window's back" and use the layers library. Another >example of this is making a clipping region. By that reasoning you should not be using Move,Draw,SetRGB4 either since these are graphics functions and you would be circumventing intuition. Intuition does not provide an 'intuition' function for every possible layer capability. We designed these libraries knowing that as programmers become more sophisticated they will need more capabilities and these capabilities need to reside in the libraries that actually do the work. Turns out, intuition handles a superbitmap window like any other window. It has no idea their is really another bitmap associated with it except at creation time when it passes the parameter to createlayer. But once it is created intuition treats it like any other layer. Think of the layer library, in your case, as an associate to intuition. It is ok to call many of the layer library functions. I guess it would be a good idea if CA spelled out which layer functions are ok to use in an intuition environment. > > > --Mike Leibow -- Dale Luck Boing, Inc. {cbmvax|oliveb|pyramid}|!amiga!boing!dale Although I do contract work for Amiga-LosGatos, my opinions probably don't represent those of Commodore or its management or its engineers, but I think the world would be a better place if they did.
rap@ardent.UUCP (Rob Peck) (08/16/88)
In article <8808132305.AA13416@decwrl.dec.com>, leibow@video.dec.com (MICHAEL LEIBOW) writes: > > Comments on Peck's book: > I read most of the book last night and believe that the book is > a good introduction to Amiga programming. It is probably in execellent way > to go before trying to understand the RKM's. BUT, disreguarding the book's > good layout, There are just as many mistakes in the examples as there is > in the RKM's. I don't have my book next to me at the moment so I can't make > too many specific examples, but I do remember: > > [specific comments deleted] > > So, if you want to learn how to program the amiga, I do suggest this book > because it is easy to read, but I suggest you be very careful when typing > in any of the examples. Go over the examples with a fine toothed comb beforea Thanks for the comments, both positive and negative, Mike. Thusfar, 10,500 copies have been sold, and a total of 7 people have offered feedback directly to me, most of which I have already incorporated into errata and made it into the third printing. I am also proud to say that the book is now available in a German translation as the "Amiga Das Programmierbuk" from SYBEX, and the Italian and Danish translations are in process. Needless to say, the faster I get corrections, the better the book will serve the needs of Amiga programmers all over the place. I want the book to be accurate and useful and I can use all the help I can get. I am going to advertise the Guide by placing an ad in the Commodore Magazine Amiga Buyers' Guide and offering to sell a package deal via mail order, containing the source/object disk that I offer through the coupon in the back of the book, WITH the book, for the retail price of the book alone (plus a small amount for shipping). The Programmers Guide was written at a time when I only had access to Amiga C, and the book states it as such. There is a good opportunity, here, Mike, to do something special for the Amiga programming community. If, as you were reading the book, you have marked areas that you believe could be improved, I would be very grateful if you could either mail me your copy of the book or produce a summary on an Amiga disk that I could add as an errata to the programming disk, and of course your name on the file as a significant contributor. The examples now work fine with Lattice 3.03 ("Amiga C") and many examples work with Manx +L, and linking with c32.lib. But prior to the first ad sale (expect to see the advertising near 10/2/88 as a packed-in-each-box-sold) I plan to rewrite the on-disk versions (and submit stuff as errata for the fourth printing) so that all examples would be fully compatible with Lattice 4 and Manx 3.6 in 16-bit int mode. (In fact, if there is anyone out there who already has available a version of the book examples on disk, 'translated' for Manx 16-bit ready to go, it'd be worth CASH to me to get it as soon as I can). So, if you already are pretty sure that you know areas that I should fix, it'll probably save me a bunch of work and I would be VERY grateful to get that feedback. Please contact me at: DATAPATH, P.O.Box 1828, Los Gatos, Ca 95031-1828. By the way, the use of "fprintf(dos_fh,"%ls","Hello, World);" has a comment attached to it "/* amiga.lib func */". Indeed, the amiga.lib version of fprintf DOES accept an AmigaDOS file handle. I SHOULD, however, add a special note as an errata to indicate that if using linking with lc.lib first instead of amiga.lib, you'd get a function that needed a different kind of file handle. Better still, I should not have used fprintf at all. But the example, as shown, is not in error when linking amiga.lib first. Also, though not so obvious from the position in the book (page 343, 344, about the Amiga C compiler), I took two pages to describe "makesimple.a" - a variation on the original makesimple file that puts amiga.lib first in the link phase, particularly for the examples in chapter 2. A cross reference to those pages would definitely be appropriate and I'll see that it gets done. No doubt, I'll try to get SYBEX to add pages to the compiler chapter to handle the other compilers I now have. Your comment pointed out a real possibility of confusion for new users and I certainly thank you for noticing that. Oh, and if Tom Rokiki is listening - if there is a later version of ShowDate() available, I'd like to get it from you. I keep forgetting to ask you about it when we are at BADGE. I believe the version I have breaks after 199X and I plan to continue to use Amy past that date. Thanks. Rob Peck