home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / csmpdigest / csmp-digest-v3-004 < prev    next >
Text File  |  2010-09-21  |  54KB  |  1,321 lines

  1. Received-Date: Tue, 15 Mar 1994 16:31:08 +0100
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: C.S.M.P. Digest, Issue 3.004
  4. To: csmp-digest@ens.fr
  5. Date: Tue, 15 Mar 94 16:31:03 MET
  6. X-Mailer: ELM [version 2.3 PL11]
  7. Errors-To: listman@ens.fr
  8. Reply-To: pottier@clipper.ens.fr
  9. X-Sequence: 5
  10.  
  11. C.S.M.P. Digest             Tue, 15 Mar 94       Volume 3 : Issue 4
  12.  
  13. Today's Topics:
  14.  
  15.         Code optimization
  16.         Getting Started with TCL
  17.         How would you write a text-based log window?
  18.         Reducing screen flicker in simple animation.
  19.         What to say when the appropiate Gestalts aren't there?
  20.         small snag
  21.  
  22.  
  23.  
  24. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  25. (pottier@clipper.ens.fr).
  26.  
  27. The digest is a collection of article threads from the internet newsgroup
  28. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  29. regularly and want an archive of the discussions.  If you don't know what a
  30. newsgroup is, you probably don't have access to it.  Ask your systems
  31. administrator(s) for details.  If you don't have access to news, you may
  32. still be able to post messages to the group by using a mail server like
  33. anon.penet.fi (mail help@anon.penet.fi for more information).
  34.  
  35. Each issue of the digest contains one or more sets of articles (called
  36. threads), with each set corresponding to a 'discussion' of a particular
  37. subject.  The articles are not edited; all articles included in this digest
  38. are in their original posted form (as received by our news server at
  39. nef.ens.fr).  Article threads are not added to the digest until the last
  40. article added to the thread is at least two weeks old (this is to ensure that
  41. the thread is dead before adding it to the digest).  Article threads that
  42. consist of only one message are generally not included in the digest.
  43.  
  44. The digest is officially distributed by two means, by email and ftp.
  45.  
  46. If you want to receive the digest by mail, send email to listserv@ens.fr
  47. with no subject and one of the following commands as body:
  48.     help                        Sends you a summary of commands
  49.     subscribe csmp-digest Your Name    Adds you to the mailing list
  50.     signoff csmp-digest            Removes you from the list
  51. Once you have subscribed, you will automatically receive each new
  52. issue as it is created.
  53.  
  54. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  55. Questions related to the ftp site should be directed to
  56. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  57. digest are available there.
  58.  
  59. Also, the digests are available to WAIS users as comp.sys.mac.programmer.src.
  60.  
  61.  
  62. -------------------------------------------------------
  63.  
  64. >From alex@metcalf.demon.co.uk (Alex Metcalf)
  65. Subject: Code optimization
  66. Date: Sun, 27 Feb 1994 23:49:17 GMT
  67. Organization: Demon Internet
  68.  
  69.  
  70.         I'm working on an arcade game which, when being played, goes
  71. through a "loop" of code every 2 ticks. In this time, it's calling various
  72. functions, doind some calculations, then copying graphics to the screen.
  73.  
  74.         Since it's only just keeping up on my LC475 (!), I need to optimise
  75. my code so that it works comfortably on 68030 Macs. I want to find out how
  76. long each function call in my loop is taking, but obviously, checking the
  77. ticks won't work. A resolution of time such as 10ths of a tick would be
  78. useful. I can see that I'm going to have to use the Time manager (is that
  79. what it's called?), but I get the impression that it will be more work than
  80. it's worth to implement.
  81.  
  82.         If this task proves hard, could someone give me some suggestions as
  83. to how I could improve the following operations?
  84.  
  85. % Copying 24 x 24 pixel graphics to the window (using CopyBits and
  86. CopyMask)
  87. % Dividing numbers (I'm using, e.g. bigNum/littleNum)
  88. % Copying between GWorlds (all 8 bit, 640x480; I'm using CopyBits /
  89. CopyMask).
  90.  
  91.         I'd like faster routines, if possible, but I don't want them if it
  92. means compromising compatibility with other (or future) Macs. That'll be
  93. the day.. :-)
  94.  
  95.         Thanks,
  96.  
  97.  
  98.  
  99.         Alex
  100.  
  101. --
  102. Alex Metcalf, Mac programmer in C, C++, HyperTalk, assembler
  103.  
  104. Internet, AOL, BIX:     alex@metcalf.demon.co.uk
  105. AppleLink:              alex@metcalf.demon.co.uk@internet#
  106. CompuServe:             INTERNET:alex@metcalf.demon.co.uk
  107. Delphi:                 alex@metcalf.demon.co.uk@inet#
  108. FirstClass:             alex@metcalf.demon.co.uk,Internet
  109. Fax (UK):               (0570) 45636
  110. Fax (US / Canada):      011 44 570 45636
  111.  
  112. +++++++++++++++++++++++++++
  113.  
  114. >From ejohnson@netcom.com (Eric Johnson)
  115. Date: Mon, 28 Feb 1994 00:57:33 GMT
  116. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  117.  
  118. Alex Metcalf (alex@metcalf.demon.co.uk) wrote:
  119.  
  120. > If this task proves hard, could someone give me some suggestions as
  121. > to how I could improve the following operations? 
  122.  
  123. > Copying 24 x 24 pixel graphics to the window (using CopyBits and
  124. > CopyMask) 
  125. > Dividing numbers (I'm using, e.g. bigNum/littleNum)
  126. > Copying between GWorlds (all 8 bit, 640x480; I'm using CopyBits /
  127. > CopyMask).
  128.  
  129. I wrote my own CopyBits for a game that I was writing.  I can dig it
  130. out and post it here.  I can give you the following suggestions
  131. though.
  132.  
  133. If you've created your icons with ResEdit, you should load them into a
  134. gWorld whose color table is the same one that you will eventually
  135. display your icons.  This will speed up the process because you will
  136. not have to worry about "recoloring" your icons into the new table.
  137. Consider this gWorld your palette of icons from which you will copy.
  138.  
  139. Then, you need to roll your own CopyBits.  You can optimize the hell
  140. out of this by creating a loop that uses a nice Motorola 680x0
  141. instruction that will decrease a data register, and branch if the data
  142. register is still not zero.  Its a good instruction to use, because it
  143. assumes that the jump will occur, and not flush the pipeline.  I'll be
  144. damned if I can remember the exact name of this instruction.  It
  145. starts with a d, I think.  Sorry, I just can't remember.  If you don't
  146. have a  Motorola 68030 or 68040 book, now is the time to get one.
  147.  
  148. You should construct the loop so that it will fill up the instruction
  149. cache, or at least use most of it.  That way, when the first run
  150. through of the loop occurs, the code will find its way into the
  151. instruction cache.  On the second run of the loop, its all in the
  152. cache so it runs like a champ.
  153.  
  154. You might also get better performance in your loop by reading in as
  155. much data as you can into the data registers.  Then, write it to the
  156. destination buffer in one swoop.  I think this might help a touch
  157. because you should be able to maximize the performance of the data
  158. registers.
  159.  
  160. There are some other optimizations that I made, but I don't remember.
  161. I'll have to dig out that code for you.  It was pretty damn fast.  It
  162. should be a bit faster for you, because you shouldn't need any
  163. masking.  I suppose others might find it useful too, so I'll get
  164. around to posting it.  My only request is that I get credit in
  165. someone's about box.
  166.  
  167. -Eric
  168. -- 
  169. Eric E Johnson
  170. ejohnson@netcom.netcom.com   
  171.  
  172. +++++++++++++++++++++++++++
  173.  
  174. >From al@crucible.powertools.com (Al Evans)
  175. Date: 28 Feb 94 17:12:02 GMT
  176. Organization: PowerTools, Austin, Texas
  177.  
  178. In article <alex-270294234959@metcalf.demon.co.uk> alex@metcalf.demon.co.uk (Alex Metcalf) writes:
  179.  
  180. >I can see that I'm going to have to use the Time manager (is that
  181. >what it's called?), but I get the impression that it will be more work than
  182. >it's worth to implement.
  183.  
  184. Actually, it's not difficult. Set up a Time Manager task that calls
  185. back every millisecond, and have the task increment a field in your
  186. (extended) Time Manager record. Look at this field before and after
  187. your function call. The difference is how long the function took to
  188. execute. 
  189.  
  190. >% Copying 24 x 24 pixel graphics to the window (using CopyBits and
  191. >CopyMask)
  192. >% Dividing numbers (I'm using, e.g. bigNum/littleNum)
  193. >% Copying between GWorlds (all 8 bit, 640x480; I'm using CopyBits /
  194. >CopyMask).
  195.  
  196. If I recall correctly, CopyBits with a mask region is substantially
  197. faster than CopyMask. But you should try to set up your copying
  198. such only the final copy is offscreen-to-onscreen, and this copy
  199. can be made with a call to CopyBits in srcCopy mode. Then, for
  200. your offscreen-to-offscreen copying, you can write your own masked
  201. copy routine optimized for 24X24 graphics.
  202.  
  203.                     --Al Evans--
  204. -- 
  205.  
  206. Al Evans                         Tu causes, tu causes
  207. al@crucible.powertools.com               C'est tout ce que tu sais faire
  208. cs.utexas.edu!crucible!al                     -- LaVerdure
  209.  
  210. ---------------------------
  211.  
  212. >From darick@zippy.nimh.nih.gov (Darick DeHart)
  213. Subject: Getting Started with TCL
  214. Date: Mon, 28 Feb 1994 14:49:56 GMT
  215. Organization: RSB/NIH
  216.  
  217. I have been struggling with Think Class Library for about a week.  I am a
  218. good C programmer with some experience in both Macintosh and Object
  219. Oriented programming.  I am hoping that mastering TCL will allow me to
  220. quickly develop simple Macintosh Applications.  
  221.  
  222. Are there any books (besides the Symantec TCL Guide) that provide "Getting
  223. Started" type information.  
  224.  
  225. I'm also interested in people's opinions on TCL.  Is learning it worth the
  226. investment in time?  How long does it take to become comfortable with the
  227. library?
  228.  
  229. +++++++++++++++++++++++++++
  230.  
  231. >From murphybf@rtsg.mot.com (Brendan F. Murphy)
  232. Date: 28 Feb 1994 18:58:15 GMT
  233. Organization: Motorola Cellular
  234.  
  235. In article <darick-280294085521@terrapin.ninds.nih.gov>, you write:
  236. |> I have been struggling with Think Class Library for about a week.  I am a
  237. |> good C programmer with some experience in both Macintosh and Object
  238. |> Oriented programming.  I am hoping that mastering TCL will allow me to
  239. |> quickly develop simple Macintosh Applications.  
  240.  
  241. What you say is true, but it takes a while to master TCL.  The trick is
  242. to not force TCL to do something it was not designed to do.  In other
  243. words, make your application fit TCL way of doing things and you'll be
  244. a much happier camper (until you become more experienced in TCL).
  245.  
  246. |> Are there any books (besides the Symantec TCL Guide) that provide "Getting
  247. |> Started" type information.  
  248.  
  249. There's the code!  I'm serious about that one!!  This is how you find
  250. out the deep dark secretes of TCL.
  251.  
  252. |> I'm also interested in people's opinions on TCL.  Is learning it worth the
  253. |> investment in time?  How long does it take to become comfortable with the
  254. |> library?
  255.  
  256. It all depends on the job you are trying to accomplish.  If your doing a
  257. medium to small application TCL may be the ticket for you.  If your
  258. doing something that's real industrial strength then MacApp might be
  259. the way to go.  I have found it to be worth learning and useful as a
  260. framework, but PowerPlant just might change my mind in the future when
  261. I get a hold of it.
  262.  
  263. There is a news group dedicated to to TCL called comp.sys.mac.oop.tcl
  264. and you might want to defer questions to that group.  Also there is an
  265. ftp site for a bunch of TCL classes at ftp.brown.edu.
  266.  
  267. Hope this helps.
  268.  
  269. +++++++++++++++++++++++++++
  270.  
  271. >From dent@perth.DIALix.oz.au (Andrew Dent)
  272. Date: 1 Mar 1994 17:36:10 +0800
  273. Organization: DIALix Services, Perth, Western Australia
  274.  
  275. Darick
  276.  
  277. Depending on what you are doing with TCL, you may want to escape from some
  278. of the hassles by using an interface editor/generator program.
  279.  
  280. Both AppMaker and Marksman generate excellent TCL code (immodest bit here:
  281. I wrote the Marksman TCL templates). I believe Marksman is better value for
  282. money and certainly the current version has better interface support, 
  283. including full color.
  284.  
  285. Marksman demos are available on most ftp sites that mirror info-mac or
  286. umich. The code demos are posted separately from the editor demo, which
  287. lets you do everything but save a prototype.
  288.  
  289. The TCL code demos should be on their way by now.
  290.  
  291. In general, my advice to TCL beginners is "relax and don't try to learn it
  292. all". You can do an amazing amount with TCL without having to learn too much
  293. about it's internals, until you need to change the standard behaviours.
  294.  
  295. Andy Dent (A.D. Software - Mac & VAX programming)
  296. 94 Bermuda Dve, BALLAJURA  Western Australia  6066
  297. Phone/Fax: 09 249 2719 (local)  +619 249 2719 (International)
  298.        Internet: dent@DIALix.oz.au    Compuserve: 100033,3241
  299.  
  300.  
  301. ---------------------------
  302.  
  303. >From egurney@vcd.hp.com (Eddy J. Gurney)
  304. Subject: How would you write a text-based log window?
  305. Date: Wed, 23 Feb 1994 23:39:46 GMT
  306. Organization: Hewlett-Packard VCD
  307.  
  308. I'm wondering if anyone has any suggestions to implementing a simple,
  309. fast, and effective read-only text-based log window. I have the need to
  310. have a window open to which I would write various status messages while
  311. the application runs. Since the this application could run for a lengthy
  312. period of time, I'd like the older data to be discarded for newer data
  313. when the buffer reaches some predetermined size.
  314.  
  315. Currently I'm using Eric Soldan's "TextEditControl" from Apple's
  316. DTS.Lib, and it works fairly well. (If anyone's interested, it was
  317. very simple to extract this complete TextEditControl from DTS.Lib to a
  318. completely "self contained" module which can be included in a THINK C
  319. application, giving you an editable text control in a window with no
  320. effort on your part.) I'm just wondering if there is a better solution.
  321. It should do all the normal TextEdit things like selecting text, scrolling
  322. while selecting, vertical scrollbar (horizontal is not necessary in my
  323. case), etc.
  324.  
  325. I'm just wondering if using TextEdit via Eric's TextEditControl is
  326. "overkill" and adding too much overhead to something which could be much
  327. simpler. (The slowest part right now is when the buffer fills up...
  328. in that case I do a TESetSelect to select some number of bytes, call
  329. TEDelete to remove them, TESetSelect to move to the end of the data and
  330. then TEInsert to add the new text.)
  331.  
  332. Any ideas or suggestions appreciated...
  333.  
  334. Thanks,
  335. Eddy
  336.  
  337. --
  338. Eddy J. Gurney N8FPW   Hewlett-Packard Company, Vancouver (USA!) Division
  339. egurney@vcd.hp.com                       #include <standard-disclaimer.h>
  340. "Failures are divided into two classes-- those who thought and never did,
  341.       and those who did and never thought."     John Charles Salak
  342.  
  343. +++++++++++++++++++++++++++
  344.  
  345. >From mxmora@unix.sri.com (Matt Mora)
  346. Date: 23 Feb 1994 17:04:04 -0800
  347. Organization: SRI International, Menlo Park, CA
  348.  
  349. In article <CLpB2B.AoJ@vcd.hp.com> egurney@vcd.hp.com (Eddy J. Gurney) writes:
  350. >I'm wondering if anyone has any suggestions to implementing a simple,
  351. >fast, and effective read-only text-based log window. I have the need to
  352. >have a window open to which I would write various status messages while
  353. >the application runs. Since the this application could run for a lengthy
  354. >period of time, I'd like the older data to be discarded for newer data
  355. >when the buffer reaches some predetermined size.
  356.  
  357. If you don't really need character level selection (ie line level selection 
  358. would suffice), use the list manager. I've wrote a dataviewer program
  359. that display large amounts of text in a scrolling list and it supports
  360. tab stops. My intent was to create a freeware document maker/viewer. 
  361. Using the list manager is easy and fun. Ldef's are easy to write just keep
  362. the data out of the list manager.
  363.  
  364. Another program I wrote called more or less displays large amounts of text
  365. by using drawtext. I intend to make both programs support PPC and or
  366. AppleEvents so that programmers can pipe debugging output these programs
  367. and have a easy to use log. No muss no fuss AEprintf/AEwriteln. :-)
  368.  
  369.  
  370.  
  371. Xavier
  372.  
  373.  
  374. -- 
  375. ___________________________________________________________
  376. Matthew Xavier Mora                    Matt_Mora@qm.sri.com
  377. SRI International                       mxmora@unix.sri.com
  378. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  379.  
  380. +++++++++++++++++++++++++++
  381.  
  382. >From walrathw@rferl.org (WalrathW)
  383. Date: 28 Feb 94 11:05:50 -0500
  384. Organization: RFE/RL Inc.
  385.  
  386. In article <CLpB2B.AoJ@vcd.hp.com>
  387. egurney@vcd.hp.com (Eddy J. Gurney) writes:
  388.  
  389. > I'm wondering if anyone has any suggestions to implementing a simple,
  390. > fast, and effective read-only text-based log window. I have the need to
  391. > have a window open to which I would write various status messages while
  392. > the application runs. Since the this application could run for a lengthy
  393. > period of time, I'd like the older data to be discarded for newer data
  394. > when the buffer reaches some predetermined size.
  395. [deleted]
  396. > Any ideas or suggestions appreciated...
  397. > Thanks,
  398. > Eddy
  399.  
  400. I'm taking the advice suggested in a develop article several issues
  401. back, and using the Terminal Manager for simple debugging info. I've
  402. got a serial port capture application which only sends the data to
  403. files, but I added support for piping it to a TM window as well, to see
  404. what's supposed to end up in the files.
  405.  
  406. You might checkout DebugWindow library.  Here's some info from the
  407. README:
  408.  
  409.    DebugWindow is a utility that mimics the Windows 3.x program of the
  410. same name.
  411. It allows you to easily print out display strings during the
  412. development stages of
  413. your program without any of the headaches normally associated with
  414. built-in
  415. "standard I/O" functions.   
  416.  
  417.     DebugWindow's features:
  418.  
  419.  
  420.   %  full "printf()" functionality for C programmers without any added
  421. coding on
  422.       your part
  423.  
  424.   %  will remember its location and size on the screen across sessions
  425.  
  426.   %  no more hassles of trying to incorporate Think C's "stdio" window
  427.       in with your pure Toolbox code
  428.  
  429.   %  allows you to save any information that you've printed into its
  430. window to a
  431.       TeachText document 
  432.  
  433.   %  callable from either Think C or Hypercard
  434.  
  435. (Debug Window is written by Keith Ledbetter)
  436.  
  437. It's available in the usual Mac archive sites.
  438.  
  439. cheers,
  440. ______o0o______
  441.  Wayne Walrath
  442.  RFE/RL Inc.
  443.  
  444. ---------------------------
  445.  
  446. >From P.A.Brooks-Johnson@newcastle.ac.uk (P.A. Brooks-Johnson)
  447. Subject: Reducing screen flicker in simple animation.
  448. Date: Mon, 21 Feb 1994 13:17:13 GMT
  449. Organization: Computing Laboratory, U of Newcastle upon Tyne, UK NE1 7RU.
  450.  
  451.  
  452.  
  453. I'll make the apology first for this being a newbie question, but I'm in a bit of a time fix so I need some help. (and where better to look?)
  454.  
  455. A little background:
  456. I'm writing a simple algorithm animator for the Mac (and other platforms .....) I'm just moving simple rectangles round the screen so there's no need for complex animation stuff. Based on a book by Mark Watson ( Portable GUI development in C++) which IMO ain't bad, but is a bit buggy, I've got redraw etc to work OK. The problem is the screen flicker, mainly due, I guess, to constantly erasing and redrawing the object which are moving.
  457.  
  458. My solution:
  459. I propose to draw to an off screen grafPort then use copyBits to move the image from offScreen.portBits to screen.portBits.
  460.  
  461. The question:
  462. Very simple.... is this right?? Is the reduction in flicker worth the bother or shall I just spend my precious (no not precious, just very limited!) time on something else? Is there a better way? I get the impression qd provides some explicit support for this kind of thing.....
  463.  
  464. Thanks for your help, I may even understand all this one day!!!
  465.  
  466.  
  467. Peter
  468.  
  469. (P.A.Brooks-Johnson@newcastle.ac.uk)
  470.  
  471. +++++++++++++++++++++++++++
  472.  
  473. >From Michael Burks <mb1i+@andrew.cmu.edu>
  474. Date: Mon, 21 Feb 1994 11:07:53 -0500
  475. Organization: Fifth yr. senior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
  476.  
  477. Excerpts from netnews.comp.sys.mac.programmer: 21-Feb-94 Reducing screen
  478. flicker in .. by P.A. Brooks-Johnson@newc
  479. > <How do I move rectangles around the screen without flicker deleted> 
  480. > My solution:
  481. > I propose to draw to an off screen grafPort then use copyBits to move
  482. the image 
  483. > from offScreen.portBits to screen.portBits.
  484. > The question:
  485. > Very simple.... is this right?? Is the reduction in flicker worth the
  486. bother or 
  487. > shall I just spend my precious (no not precious, just very limited!)
  488. time on som
  489. > ething else? Is there a better way? I get the impression qd provides
  490. some explic
  491. > it support for this kind of thing.....
  492. > Thanks for your help, I may even understand all this one day!!!
  493. What you propose will work.  I would call it psuedo-double bufferring. 
  494. It's a common thing.  Whether you want to do it is a very subjective
  495. question.
  496.  
  497. There are lots of other solutions.  If it's just rectangles, you could
  498. easily keep track of what pixels have changed yourself (this extends to
  499. polygons), and only update them.  You could also use color cycling
  500. (animating colors).
  501.  
  502. Blaine.
  503.  
  504. +++++++++++++++++++++++++++
  505.  
  506. >From Sander C. Temme <temme@phys.uva.nl>
  507. Date: 22 Feb 94 14:00:18 +0100
  508. Organization: University of Amsterdam
  509.  
  510.  
  511.  
  512. In article <CLKswq.B8y@newcastle.ac.uk> P.A. Brooks-Johnson,
  513. P.A.Brooks-Johnson@newcastle.ac.uk writes:
  514. >The question:
  515. >Very simple.... is this right?? Is the reduction in flicker worth
  516. the bother or 
  517. >shall I just spend my precious (no not precious, just very
  518. limited!) time on 
  519. >something else? Is there a better way? I get the impression qd
  520. provides some 
  521. >explicit support for this kind of thing.....
  522. The easiest way to do this is documented in the acclaimed book 'How
  523. to Write Macintosh Software' by Scott Knaster as 'Smooth Animation
  524. for the Rest of Us': 
  525.  
  526. You can synchronize your drawing with the vertical retrace (i.e.
  527. when the electron beam moves from lower right corner to upper left
  528. corner of the screen) so you change the video RAM when no drawing is
  529. going on. When the Mac hits vertical retrace, it generates an
  530. interrupt. One of the things this interrupt does is increase the
  531. TickCount global Variable. So, what the rest of us do to get smooth
  532. animation is let our program sit in a tight loop waiting for
  533. TickCount to change, and when it does, draw like heck. 
  534. Only, this method dates from way back when multiple screens and
  535. CQuickDraw weren't an issue. You'll have to see whether it still
  536. works. When it did (when I toyed around with simple animation on a
  537. Plus), it gave nice results for all its simplicity. 
  538.  
  539. >
  540. >Thanks for your help, I may even understand all this one day!!!
  541. (-: (-:
  542.  
  543. Sander
  544.  
  545.  
  546. Sander C. Temme, University of Amsterdam, Holland temme@phys.uva.nl
  547. -------------------------------------------------------------------
  548. 'Denkt U werkelijk dat wij zo gek zijn om voor een weddenschap naar 
  549. Zuid-Afrika te vliegen?'
  550.                          -- Bob Evers
  551.  
  552. +++++++++++++++++++++++++++
  553.  
  554. >From mssmith@afterlife.ncsc.mil (M. Scott Smith)
  555. Date: Tue, 22 Feb 1994 17:22:35 GMT
  556. Organization: The Great Beyond
  557.  
  558. In article <1994Feb22.140018.4396@news.sara.nl> Sander C. Temme <temme@phys.uva.nl> writes:
  559. >
  560. >You can synchronize your drawing with the vertical retrace (i.e.
  561. >when the electron beam moves from lower right corner to upper left
  562. >corner of the screen) so you change the video RAM when no drawing is
  563. >going on. When the Mac hits vertical retrace, it generates an
  564. >interrupt. One of the things this interrupt does is increase the
  565. >TickCount global Variable. So, what the rest of us do to get smooth
  566. >animation is let our program sit in a tight loop waiting for
  567. >TickCount to change, and when it does, draw like heck. 
  568. >Only, this method dates from way back when multiple screens and
  569. >CQuickDraw weren't an issue. You'll have to see whether it still
  570. >works. When it did (when I toyed around with simple animation on a
  571. >Plus), it gave nice results for all its simplicity. 
  572. >
  573.  
  574.    Unfortunately this method doesn't work anymore, at least not for color
  575. monitors.
  576.  
  577.    The global variable "TickCount" has traditionally been updated every
  578. 1/60 of a second -- which was nicely in sync with the refresh rate on the
  579. old black and white Mac monitors.
  580.  
  581.    On color monitors, the refresh rate is rarely 60 hz., and even if it
  582. is, there's no real guarantee that it's going to be perfectly in sync
  583. with TickCount.
  584.  
  585.    What you need to do, then, is "sync up" with whatever monitor happens
  586. to be attached to the Mac.  How do you do this?  Well, luckily there's
  587. sample code floating around to do just this.  I know Mike Kelly has
  588. written some (I haven't seen him around much; must be busy with his
  589. newfound success!  :), and I believe there's some code in the Mac
  590. programming FAQ which you can download from sumex-aim.stanford.edu
  591. (among places).  Several other people have written sample code to do
  592. it.  (I'm sure Jon Witte has.)  It's not particularly friendly code,
  593. and most implementations I've seen use some assembly language.
  594.  
  595.    Just synching to the monitor isn't a full solution, however.  For
  596. this method to work as expected, you need to be sure that you can get
  597. all your drawing done in less than one screen refresh -- typically
  598. somewhere around 1/60th -> 1/70th of a second.  If it takes 1.5 screen
  599. updates to do your drawing, you're not necessarily gaining much by
  600. synching.  (I haven't done much testing so I can't say if you're better
  601. off synching than not in situations like this.  In any case, synching
  602. will almost always have the effect of slowing down your animation -- after
  603. all, you'll be spending time waiting around for that electron gun to get
  604. to the top of the screen.  I wrote a screen saver that simply animates
  605. a sphere bouncing around the screen.  I wrote directly to video RAM,
  606. and used a number of other tricks to make it as quick as possible.  The
  607. result was mind-numbingly fast animation -- the ball ricocheted (sp?) back
  608. and forth faster than the eye could see.  When I added synching, the ball
  609. moved pretty slowly -- very smoothly, yes, but it was now animating one
  610. frame in the time it was doing 40 or more before.  So, in some cases,
  611. you might want that "non-smooth" effect which you get with high-frame-rate
  612. animation.  But I digress..)
  613.  
  614.    The method you use to draw to the screen will greatly affect how much
  615. time it takes.  I didn't catch your original message, so I'm not sure
  616. if you're aware that "offscreen buffers" are the best way to achieve
  617. smooth animation.  If you're not familiar with their definition or use,
  618. I'd be happy to explain them to you.
  619.  
  620.    You generally do all of your drawing "offscreen", and copy your picture
  621. to the screen (via CopyBits or writing directly to the video RAM or
  622. directly into a PixMap, etc.) only once it's completely ready.  It's
  623. much quicker to write offscreen and the user doesn't see the individual
  624. pieces of the picture being painted, etc., which can look really bad if
  625. done on-screen.
  626.  
  627.    Well, this has been somewhat of a cluttered message but I hope you
  628. got something out of it.  Check out the programming FAQ's -- they should
  629. have information on "monitor-independent" synching, which is one step
  630. towards smooth animation.  And if you're not familiar with offscreen
  631. drawing, you'll want to look into GWorlds, which are probably the most
  632. painless way to do it.  (Plus you'll want to look around for some theory
  633. on how to best use offscreen environments -- I've seen lots of different
  634. methods, and I suppose which one you choose depends on your specific
  635. application.)
  636.  
  637.    If you're going to be doing intensive-graphics-therapy in your game/
  638. program/whatever, you might wish to look into (gasp!) drawing directly to
  639. the screen.  CopyBits is an incredibly versatile tool, but that versatility
  640. adds some overhead in many situations; it may not be the best choice
  641. for arcade-style animation.
  642.  
  643.    On that note, here's a question for those of you in the know -- I haven't
  644. had a chance to play around with the PPC much; is direct-screen drawing (if
  645. done properly) still functional with the PowerPC's?
  646.  
  647.    I've constructed a C++ "direct-screen" library which takes a lot of
  648. the pain out of direct screen drawing, I might get around to polishing
  649. it up and releasing it some day.
  650.  
  651.    Good luck!  Executing animation properly can make a big difference
  652. in the appearance of your program.  It's worth it to spend the time
  653. researching -- there's a lot to learn.
  654.  
  655. Later,
  656.  
  657. M. Scott Smith
  658.  
  659.  
  660. +++++++++++++++++++++++++++
  661.  
  662. >From john_werner@taligent.com (John Werner)
  663. Date: Tue, 22 Feb 1994 16:58:02 GMT
  664. Organization: Taligent, Inc.
  665.  
  666. In article <1994Feb22.140018.4396@news.sara.nl>, Sander C. Temme
  667. <temme@phys.uva.nl> wrote:
  668.  
  669. > You can synchronize your drawing with the vertical retrace
  670. > ....
  671. > interrupt. One of the things this interrupt does is increase the
  672. > TickCount global Variable. So, what the rest of us do to get smooth
  673. > animation is let our program sit in a tight loop waiting for
  674. > TickCount to change
  675.  
  676. This ceased to be true in 1987 with the advent of the Mac II.  On machines
  677. with Color Quickdraw, the global TickCount counter is not necessarily tied
  678. to the refresh rate on any particular monitor.  TickCount is increment 60
  679. times a second, while the refresh rate on most monitors these days is in
  680. the 65-75 Hz range.
  681.  
  682. There's still a way to get what you want, however.  You need to figure out
  683. which screen your window is (mostly) on, by looping through all the screen
  684. devices with routines like GetNextDevice.  Then you find the slot number
  685. for that device and install your VBL task with SlotVInstall.
  686.  
  687. I have a TCL class that does all this in the TCL archives at brown.edu. 
  688. You won't be able to use the code unless you're writing a TCL app, but it
  689. might help you get started.  The class is called CVblSync or some such
  690. thing.
  691.  
  692. -- 
  693. John Werner                           john_werner@taligent.com  
  694. Taligent, Inc.
  695.  
  696. +++++++++++++++++++++++++++
  697.  
  698. >From Arsenault_C@msm.cdx.mot.com (Chris Arsenault)
  699. Date: Tue, 22 Feb 1994 12:58:35 -0500
  700. Organization: Motorola Codex
  701.  
  702. In article <CLKswq.B8y@newcastle.ac.uk>, P.A.Brooks-Johnson@newcastle.ac.uk
  703. (P.A. Brooks-Johnson) wrote:
  704.  
  705. > The problem is the screen flicker, mainly due, I guess, to constantly erasing and redrawing the object which are moving.
  706. > My solution:
  707. > I propose to draw to an off screen grafPort then use copyBits to move the image from offScreen.portBits to screen.portBits.
  708.  
  709. This is great if you have a lot of internal animation to deal with (like a
  710. figure walking while moving across the screen).  It may not be necessary if
  711. you're doing something simple like drawing solid color rects on the screen.
  712. There are several possible ways to reduce flickering animation, and they
  713. may be combined:
  714.  
  715.  - use the VBL to sync so you draw only during vertical retrace.  This
  716. gives you the best results. You can loop and wait for the retrace by
  717. watching ticks. Try to write your function so you can handle events etc
  718. while waiting for vertical retrace to come around. The trick here is arrive
  719. at the draw function with very few ticks to waste.  You can also install a
  720. VBL task to perform the drawing (just don't allow Memory Mgr memory moves
  721. to occur during the interrupt) Make sure you switch the saved screen port
  722. in before drawing. Provided you're just doing a minimal amount of drawing
  723. this will work nicely.
  724. There is a couple of things you should be aware of when using VBL sync for
  725. drawing - in general it works, but on various monitors (which use different
  726. refresh rates) it's not always flicker-free.  Getting good results in that
  727. situation is a whole book in itself.
  728.  
  729. - queue up all your drawing objects (prepare a draw list) ahead of time. 
  730. When you get the VBL sync all you do is draw - fast.  This means you don't
  731. combine calculations with drawing time. Do all your calculations while the
  732. user is looking at the last image.
  733.  
  734.  - calculate minimum update rects for each moving object on screen. Just
  735. determine the deltas between where the old image was drawn and where the
  736. new one needs to be, then draw that. For example if I have a rectangle
  737. moving horizontally across the screen, all I have to erase is the
  738. difference of the move, and draw the move difference on the other side.
  739. (Erase a small rectangle on one side and draw a small rectangle on the
  740. other)  This works best when you have solid colors to animate, and the size
  741. and number of rectangles justifies the overhead for the calls and
  742. calculations. This technique is great for flight simulators where you have
  743. to do polygon manipulation and provide really fast frame rates.
  744.  
  745. - buffered offscreen minimal update. When you have a number of different
  746. objects moving around the screen and you'll be spending more time either
  747. trying to grab the video card (NuBus) or trying to restore a background,
  748. create an offscreen port and do your drawing there. The area that you want
  749. to draw to the screen is the union of the previously drawn rect and the
  750. union of all the new rects to draw. Create the drawing list, restore
  751. background or previous,  draw all the rects over this , then wait for VBL,
  752. then CopyBits the offscreen image (just the minimal update union rect) to
  753. the screen.
  754.  
  755. - color cycle animation can be really quick, but animating colors are best
  756. used inside some other image which is copyed to the screen via one of the
  757. methods suggested above. 
  758. I tried to do a simple scrolling effect using color cycling behind moving
  759. images, it looked okay, but called for more color management overhead than
  760. the effect was  worth.
  761.  
  762. Hope this helps,
  763. Chris
  764.  
  765. -- 
  766. #include <UsualLegalDisclaimers.h>
  767.  
  768. +++++++++++++++++++++++++++
  769.  
  770. >From s_heidri@iraul1.ira.uka.de (Dietmar Heidrich)
  771. Date: 28 Feb 1994 14:54:15 GMT
  772. Organization: University of Karlsruhe, FRG
  773.  
  774.  
  775. As a visitor to this group, I'd like to know if there is
  776. double-buffering for the Mac, meaning you can draw in the
  777. background and display a foreground screen and exchange both
  778. at vertical blank.  This is the best technique for providing
  779. smooth animation.
  780.  
  781. Now: Is this possible with the Mac toolbox ?  I could not find
  782. anything about it in the Inside MacIntosh books.
  783.  
  784. Personal mail preferred, as I don't read this group.  Of course,
  785. you may also reply in public and PM.
  786.  
  787. Thanks.
  788.  
  789.  
  790.  
  791. --
  792. Dietmar Heidrich, Universitaet Karlsruhe, Germany
  793.  
  794.  
  795. "Die Hoffnung auf den Tod ist das einzige, was mich am Leben erhaelt."
  796.  
  797. ---------------------------
  798.  
  799. >From partingt@fwi.uva.nl (Vincent Partington)
  800. Subject: What to say when the appropiate Gestalts aren't there?
  801. Date: 23 Feb 1994 11:11:23 GMT
  802. Organization: FWI, University of Amsterdam
  803.  
  804. Hi!
  805.  
  806. Apple advises developers to check the Gestalt-selectors to determine of
  807. certain System features are available instead of checking for System version.
  808. In my Sys7-only app (supporting Sys6 is just too cumbersome because about half
  809. of my systemcalls are Sys7-ones in my not-too-big app) I first check for
  810. the availability of Gestalt and then check all kinds of Gestalt-selectors
  811. for stuff like FSSpec-calls, new Standard File calls, Alias Manager, etc, etc.
  812.  
  813. When I don't find those features I will have to let the user know and will have
  814. to pop up an alert telling him to upgrade or die. What should this alert say?
  815. Saying "You'll have to upgrade to Sys7 or later" is contradictory to checking
  816. Gestalt because Sys8 may not have the FSSpec-calls (small chance).
  817. Saying "You'll have to upgrade to System 7.1.6" (which I use) would be
  818. weird if Sys8 can do everything Sys7.1.6 can.
  819. Saying "Get a system thet has the Gestalt-trap, returns a 1 in bits 0 and 1 of
  820. the return from Gestalt-selector for the file system, returns 1 in bit 0 of
  821. the returnvalue from Gestalt-selector...etc...etc." would be rather
  822. user-unfriendly.
  823.  
  824. Any comment?
  825.  
  826. Vincent.
  827. -- 
  828. BLABLABLABLABLABLABLABLABLABLABLABLABLABLABLA   Internet : partingt@fwi.uva.nl
  829. BLABLA 68040 Power! ABLABLABLABLABLABLABLABLA              vincent@tnc.nl
  830. BLABLABLABLABLABLABLABLABLABLABLABLABLABLABLA   FidoNet  : 2:281/202.15
  831. BLABLABLABLABLABLABLABLABLABLABLABLABLABLABLA   NeST     : 90:500/202.15
  832.  
  833. +++++++++++++++++++++++++++
  834.  
  835. >From hrafal@copernicus.bbn.com (Howie Rafal)
  836. Date: 23 Feb 1994 19:31:09 GMT
  837. Organization: BBN, Inc
  838.  
  839. In article <2kfdkr$ki1@hermes.fwi.uva.nl>, partingt@fwi.uva.nl (Vincent
  840. Partington) wrote:
  841. > When I don't find those features I will have to let the user know and will 
  842. > have
  843.  
  844. You could first check what version of the system is running and give the
  845. version  message if it applies.  Otherwise, If the system version is 7.x or
  846. greater, explain that certain necessary features are missing from the
  847. Macintosh and then give a list box of the missing managers (if they care). 
  848. This would be better than listing just one manager is missing.  They could
  849. then upgrade as needed.
  850.  
  851. +++++++++++++++++++++++++++
  852.  
  853. >From Pascal_Haakmat
  854. Date: Wed, 23 Feb 94 20:08:28 +0100
  855. Organization: (none)
  856.  
  857.  VP> What should this alert say?
  858.  
  859. Well, be honest with the user, tell him what's going on ...
  860.  
  861. Like: "Your system does not support the required FSSpec File Manager
  862. calls."
  863. If Gestalt returns a system version < 7 you might add "You should
  864. upgrade to System 7."
  865.  
  866.  
  867.  
  868.     Pascal.
  869.  
  870. --- Obolus 1.0.2
  871.  * Origin:  go on upstairs with your sweet little wishes  (2:281/202.13)
  872.  
  873. +++++++++++++++++++++++++++
  874.  
  875. >From wdh@netcom.com (Bill Hofmann)
  876. Date: Fri, 25 Feb 1994 18:20:07 GMT
  877. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  878.  
  879. Pascal_Haakmat writes:
  880. > VP> What should this alert say?
  881. >Well, be honest with the user, tell him what's going on ...
  882. >Like: "Your system does not support the required FSSpec File Manager
  883. >calls."If Gestalt returns a system version < 7 you might add "You should
  884. >upgrade to System 7."
  885. Or, perhaps, "_MakeFSSpec is not available." :->  Better yet, explain in
  886. details that are useful to the typical user:
  887.     "<This Program> requires System 7 or later."
  888. or
  889.     "<This program> requires a floating point unit."
  890. or
  891.     "<This program> requires color support (Mac II or better)."
  892. If you really think the user wants to know which particular feature
  893. isn't available, encode it as a little digit somewhere, and put it in
  894. the documentation.  Since one can't get the revised file manager
  895. *without* System 7, telling them they need it won't really help them
  896. solve their problem.
  897. -- 
  898. -Bill Hofmann                    wdh@netcom.COM
  899.  Fresh Software and Instructional Design    +1 510 524 0852
  900.  
  901. +++++++++++++++++++++++++++
  902.  
  903. >From gurgle@netcom.com (Pete Gontier)
  904. Date: Sat, 26 Feb 1994 22:34:34 GMT
  905. Organization: cellular
  906.  
  907. wdh@netcom.com (Bill Hofmann) writes:
  908.  
  909. >the documentation.  Since one can't get the revised file manager
  910. >*without* System 7, telling them they need it won't really help them
  911. >solve their problem.
  912.  
  913. Untrue. One can get it with QuickTime. I'm not sure if the Gestalt
  914. selector gets installed, though. I believe you have to test for
  915. QuickTime *or* the new File Manager calls, and then use the subset of
  916. the new File Manager calls which are in QuickTime.
  917.  
  918. This is a thorny problem, and in general I think you are right to
  919. suggest that the message talk about System 7 instead of the new File
  920. Manager calls, but in this particular case, there is a solution other
  921. than System 7. It's hard to know what to put in the message.
  922. -- 
  923.  Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
  924.  
  925. +++++++++++++++++++++++++++
  926.  
  927. >From rgaros@bio.vu.nl (Rene G.A. Ros)
  928. Date: Sun, 27 Feb 1994 09:17:37 GMT
  929. Organization: VU Biology, Amsterdam, The Netherlands
  930.  
  931. gurgle@netcom.com (Pete Gontier) writes:
  932. : wdh@netcom.com (Bill Hofmann) writes:
  933. : >the documentation.  Since one can't get the revised file manager
  934. : >*without* System 7, telling them they need it won't really help them
  935. : >solve their problem.
  936. : Untrue. One can get it with QuickTime. I'm not sure if the Gestalt
  937. : selector gets installed, though. I believe you have to test for
  938. : QuickTime *or* the new File Manager calls, and then use the subset of
  939. : the new File Manager calls which are in QuickTime.
  940.  
  941. >From my Suppl. Gestalt Selectors list:
  942.  
  943. QuickTime
  944. ---------
  945. If you install QuickTime under System 6, a major portion of the Alias
  946. Manager and FSSpec support is also added. But, QT doesn't implement the
  947. Gestalt selectors because the implementation is not complete. You must
  948. check for either Alias Mgr or QuickTime. (Michael Hecht)
  949. If QuickTime is present, assume you have an Alias Manager, subject to some
  950. limitations (NewAliasMinimalFromFullPath not present). Nearly all the
  951. FSSpec calls are available (except FSpExchangeFiles) in System 6 when
  952. QuickTime is installed. See for more information Technical Note
  953. M.QT.MovieTB.Q&As (QT 510).
  954.  
  955.  
  956. Regards,
  957. Rene
  958. -- 
  959.  
  960. --------------------------------------------------------------------------------
  961.   Rene G.A. Ros                                      Amsterdam, The Nederlands
  962.   rgaros@bio.vu.nl         rgaros@nikhefk.nikhef.nl          rener@htsa.aha.nl
  963.  
  964. +++++++++++++++++++++++++++
  965.  
  966. >From partingt@fwi.uva.nl (Vincent Partington)
  967. Date: 27 Feb 1994 15:21:01 GMT
  968. Organization: FWI, University of Amsterdam
  969.  
  970. rgaros@bio.vu.nl (Rene G.A. Ros) writes:
  971.  
  972. >QuickTime
  973. >---------
  974. >If you install QuickTime under System 6, a major portion of the Alias
  975. >Manager and FSSpec support is also added. But, QT doesn't implement the
  976. >Gestalt selectors because the implementation is not complete. You must
  977. >check for either Alias Mgr or QuickTime. (Michael Hecht)
  978. >If QuickTime is present, assume you have an Alias Manager, subject to some
  979. >limitations (NewAliasMinimalFromFullPath not present). Nearly all the
  980. >FSSpec calls are available (except FSpExchangeFiles) in System 6 when
  981. >QuickTime is installed. See for more information Technical Note
  982. >M.QT.MovieTB.Q&As (QT 510).
  983.  
  984. What a shame, no FSpExchangeFiles! That's the one I really like about the
  985. new calls. Well, I think assuming the FSSpec calls are then when QuickTime is,
  986. is weird anyway, so I wouldn't have checked one way or another.
  987. I really like a lot of other things about Sys7 too: Alias Manager, Find Folder,
  988. Popup CDEF, Apple Events, Notification manager, Temporary Memory (OK,
  989. MultiFinder has it too, but not "real" temp mem), CustomGetFile, so supporting
  990. Sys6 would be a real drag.
  991.  
  992. Vincent.
  993. -- 
  994. VI is better than Emacs.      | Let's     | Internet : partingt@fwi.uva.nl
  995. MacOS is better than Windows. | start the |            vincent@tnc.nl
  996. Unix is better than VMS.      | religious | FidoNet  : 2:281/202.15
  997. Eiffel is better than C++.    | war!!     | NeST     : 90:500/202.15
  998.  
  999. +++++++++++++++++++++++++++
  1000.  
  1001. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1002. Date: 28 Feb 94 16:30:50 +1300
  1003. Organization: University of Waikato, Hamilton, New Zealand
  1004.  
  1005. In article <gurgleCLus1o.4EK@netcom.com>, gurgle@netcom.com (Pete Gontier) writes:
  1006. > wdh@netcom.com (Bill Hofmann) writes:
  1007. >
  1008. >>the documentation.  Since one can't get the revised file manager
  1009. >>*without* System 7, telling them they need it won't really help them
  1010. >>solve their problem.
  1011. >
  1012. > Untrue. One can get it with QuickTime. I'm not sure if the Gestalt
  1013. > selector gets installed, though. I believe you have to test for
  1014. > QuickTime *or* the new File Manager calls, and then use the subset of
  1015. > the new File Manager calls which are in QuickTime.
  1016. >
  1017. > This is a thorny problem, and in general I think you are right to
  1018. > suggest that the message talk about System 7 instead of the new File
  1019. > Manager calls, but in this particular case, there is a solution other
  1020. > than System 7. It's hard to know what to put in the message.
  1021.  
  1022. My ad hoc, informal guideline, which I just thought up off the top of my
  1023. head, is "explain just the simplest case". If you need the new File Manager
  1024. calls, then I personally would just say "I need System 7 or later". If in
  1025. fact the program can be made to work under 6.0.7 with QuickTime installed,
  1026. then you can explain that in the documentation somewhere, or as an answer
  1027. to a tech support question. Don't try to burden your compatibility messages
  1028. with all the possible situations. It's less confusing that way.
  1029.  
  1030. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1031. Info & Tech Services Division              fax: +64-7-838-4066
  1032. University of Waikato            electric mail: ldo@waikato.ac.nz
  1033. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  1034. "Classical Paintings: DaVinci, Degauss, Rembrant, Van Gogh and more! View
  1035. the works of history's finest artists."  -- ad quoted in PC Magazine
  1036.  
  1037. +++++++++++++++++++++++++++
  1038.  
  1039. >From alana@cs.uoregon.edu (Alan Akins)
  1040. Date: 28 Feb 1994 08:24:00 -0800
  1041. Organization: The uncharted backwaters of the unfashionable end of the                  Western Spiral arm of the Galaxy.
  1042.  
  1043. In article <1994Feb27.091737.5150@bio.vu.nl>,
  1044. Rene G.A. Ros <rgaros@bio.vu.nl> wrote:
  1045.  
  1046. >If you install QuickTime under System 6, a major portion of the Alias
  1047. >Manager and FSSpec support is also added. But, QT doesn't implement the
  1048. >Gestalt selectors because the implementation is not complete. You must
  1049. >check for either Alias Mgr or QuickTime. (Michael Hecht)
  1050. >If QuickTime is present, assume you have an Alias Manager, subject to some
  1051. >limitations (NewAliasMinimalFromFullPath not present). Nearly all the
  1052. >FSSpec calls are available (except FSpExchangeFiles) in System 6 when
  1053. >QuickTime is installed. See for more information Technical Note
  1054. >M.QT.MovieTB.Q&As (QT 510).
  1055.  
  1056. Is this still true of QuickTime 2.0? Have they "completed" the implementation?
  1057.  
  1058. /Alan\
  1059. -- 
  1060. *      "Evan's been doing parallel       |    Alan Akins                      *
  1061. *           processing for so long...    |    alana@cs.uoregon.edu            *
  1062. *                 he's beside himself."  |    University of Oregon            *
  1063. *                        - Me            |    Department of Computer Science  *
  1064.  
  1065. +++++++++++++++++++++++++++
  1066.  
  1067. >From rgaros@paramount.nikhefk.nikhef.nl (Rene Ros)
  1068. Date: Mon, 28 Feb 1994 17:52:43 GMT
  1069. Organization: NIKHEFK
  1070.  
  1071. alana@cs.uoregon.edu (Alan Akins) writes:
  1072. : In article <1994Feb27.091737.5150@bio.vu.nl>,
  1073. : Rene G.A. Ros <rgaros@bio.vu.nl> wrote:
  1074. : >If you install QuickTime under System 6, a major portion of the Alias
  1075. : >Manager and FSSpec support is also added. But, QT doesn't implement the
  1076. : >Gestalt selectors because the implementation is not complete. You must
  1077. : >check for either Alias Mgr or QuickTime. (Michael Hecht)
  1078. : >If QuickTime is present, assume you have an Alias Manager, subject to some
  1079. : >limitations (NewAliasMinimalFromFullPath not present). Nearly all the
  1080. : >FSSpec calls are available (except FSpExchangeFiles) in System 6 when
  1081. : >QuickTime is installed. See for more information Technical Note
  1082. : >M.QT.MovieTB.Q&As (QT 510).
  1083. : Is this still true of QuickTime 2.0? Have they "completed" the implementation?
  1084.  
  1085. Don't shoot the messenger! :-)
  1086. I have no idea if QT 2.0 implements the Alias Mgr and FSSpec calls. Would be
  1087. nice, the gestalt selectors should then be installed also. So, simple
  1088. check for the selectors now and perhaps you will support System 6/QT in the
  1089. future?
  1090. I myself use two procedures to determine if the Alias Mgr is partially or
  1091. fully installed. Where I use the 'qtim' selector to see if it is partiallu
  1092. installed. 
  1093. If someone has anymore info about this regarding QT 2.0 I would like to
  1094. know. Or has someone the email address of 'the powers that be' at Apple? :-)
  1095. The prese release didn't say anything about it, which doesn't surprise me.
  1096.  
  1097. Rene
  1098.  
  1099.  
  1100. +++++++++++++++++++++++++++
  1101.  
  1102. >From bc@wetware.com (monsieur HAINEUX)
  1103. Date: Tue, 1 Mar 1994 00:45:14 GMT
  1104. Organization: /usr/local/lib/rn/organization
  1105.  
  1106. The problem with configuration problems is that most users will need
  1107. more explanation than you can fit in a dialog box. Even if you can fit
  1108. the whole explanation in a dialog box, most users will forget what the
  1109. dialog says as soon as it's gone, or see all those words and call Tech
  1110. Support before thinking anything through.
  1111.  
  1112. The trick is to explain the situation in a pithy, easily-memorable way
  1113. in the dialog, then explicitly point to the documentation for further
  1114. explanation.
  1115.  
  1116. For example:
  1117.  
  1118. (STOP)    Missing resources: <MyApp> cannot launch.
  1119.  
  1120.     Some necessary resources are not present in your
  1121.     Macintosh. Please check the "Configuration Requirements"
  1122.     section in your <MyApp> manual.
  1123.  
  1124.     ErrNo: <12345>            (Quit)
  1125.  
  1126. (STOP)    No Color Available: <MyApp> cannot launch.
  1127.  
  1128.     <MyApp> cannot find a color screen connected to your
  1129.     Macintosh. Please chek the "Configuration Requirements"
  1130.     section in your <MyApp> Manual.
  1131.  
  1132.     ErrNo: <12347)            (Quit)
  1133.     
  1134. It's up to you to provide the documentation that explains the whole
  1135. deal. For example, the documentation might read:
  1136.  
  1137. CONFIGURATION REQUIREMENTS
  1138.     <MyApp> requires a Mac Minus or better to run, System 7.0 or
  1139.     newer, 4 bit color, 437 MB of RAM memory, and 34K of disk
  1140.     space (minimum). We recommend for best performance, however, that
  1141.     you turn off virtual memory and make sure your entire hard
  1142.     disk is blank.
  1143.  
  1144.     If your Mac doesn't have enough memory, throw it away and buy
  1145.     a new one. If it has the required memory, but <MyApp> still
  1146.     won't launch, try turning off memory-using INITs, quitting
  1147.     other apps, and waving a dead chicken over it.
  1148.  
  1149. NOTE:
  1150.     Technically advanced users may be able to run <MyApp> by
  1151.     installing GreedManager 3.17 and FondleMonger 1.0d127c23 on
  1152.     System 6.x. If you would like support on how to set up this
  1153.     configuration, kindly submit your request on the back of a
  1154.     hundred-dollar bill to:...
  1155.  
  1156. Later, in the appendix on Error Numbers, you have your choice. If you
  1157. want to reserve a whole suite of errnos for launch fail, you can have
  1158. separate messages in the index:
  1159.  
  1160. ERNO    Explanation
  1161. 12345    GreedManager is missing. See "REQUIREMENTS" section of manual.
  1162. 12346    FondleMonger is missing. See "REQUIREMENTS" section of manual.
  1163.  
  1164. Or you can have just one:
  1165.  
  1166. ERRNO    Explanation
  1167. 12345    Mac does not meet minimum configuration requirements. See
  1168.     "REQUIREMENTS" section of manual.
  1169.  
  1170. bill coderre
  1171.  
  1172. ---------------------------
  1173.  
  1174. >From Joshua Joseph Marks <jmb1+@andrew.cmu.edu>
  1175. Subject: small snag
  1176. Date: Mon, 28 Feb 1994 18:43:17 -0500
  1177. Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
  1178.  
  1179. I have this one problem that is probably linked to not being familiar
  1180. with writing code on the MAcintosh, or it could be just a big oversite.
  1181.  
  1182. I have a structure defined as:
  1183. struct branch
  1184. {
  1185.     short type,xi,yi;
  1186. }
  1187.  
  1188.  
  1189. when running through the following code I get a BUS ERROR
  1190.  
  1191. struct element *Init_Branch (short x, short y, float direction, short length)
  1192. {
  1193.     struct element *new_element;
  1194.     
  1195.     new_element = (struct element*) malloc (sizeof (struct element));
  1196.     if (new_element == NIL) ExitToShell();
  1197.  
  1198.     new_element->xi = x_start;    
  1199.     new_element->yi = y_start;
  1200.     new_element->type = BRANCH_LENGTH; ....
  1201.  
  1202.  
  1203. The problem is of course the malloc, which screws everything up when it
  1204. gets two lines later.  I cant seem to trace where the problem is.  I
  1205. have the struct defined in a seperate header file that is included at
  1206. the top, and I have a the segments placed so that 2 contains ANSI and
  1207. the main portion, and 3 contains MacTraps and all suboordinate
  1208. proceddures.  Does the way you segment things matter?  Does ANSI have to
  1209. be somewhere.  Thanks for any suggestions and thanks doubly for
  1210. solutions.
  1211.                                                             Josh
  1212.  
  1213.  
  1214. +++++++++++++++++++++++++++
  1215.  
  1216. >From mssmith@afterlife.ncsc.mil (M. Scott Smith)
  1217. Date: Tue, 1 Mar 1994 01:19:14 GMT
  1218. Organization: The Great Beyond
  1219.  
  1220. In article <IhQc6Jy00WBMA_Tkot@andrew.cmu.edu> Joshua Joseph Marks <jmb1+@andrew.cmu.edu> writes:
  1221. >I have this one problem that is probably linked to not being familiar
  1222. >with writing code on the MAcintosh, or it could be just a big oversite.
  1223. >
  1224. > (problem described)
  1225. >
  1226. >The problem is of course the malloc, which screws everything up when it
  1227. >gets two lines later.  I cant seem to trace where the problem is.  I
  1228. >have the struct defined in a seperate header file that is included at
  1229. >the top, and I have a the segments placed so that 2 contains ANSI and
  1230. >the main portion, and 3 contains MacTraps and all suboordinate
  1231. >proceddures.  Does the way you segment things matter?  Does ANSI have to
  1232. >be somewhere.  Thanks for any suggestions and thanks doubly for
  1233. >solutions.
  1234. >                                                            Josh
  1235. >
  1236.  
  1237. Josh,
  1238.  
  1239.    I'm going to take a very wild guess of what *might* be your problem,
  1240. without studying your code too much.
  1241.  
  1242.    If you're not including <stdlib.h>, MAKE SURE you do.  At the start of
  1243. your program, do this:
  1244.  
  1245. #include <stdlib.h>
  1246.  
  1247.    If you're not doing this, then I'd suspect that's your problem, because
  1248. I've had the same problem in the past.  If I recall correctly, there's
  1249. a couple different versions of malloc out there, and unless you include
  1250. stdlib.h you're not getting the right one.  (I forget the exact
  1251. reasoning behind this.)  The standard libraries reference for Think C
  1252. (as well as Think Reference 2.0 database module included w/Think C v6.0x)
  1253. mentions that "if you have any problems with malloc(), make sure you
  1254. #included stdlib.h in your source file.  I believe it.
  1255.  
  1256.    So definitely do that if you aren't.  If you are, well, umm, uhh..
  1257. Sorry to have gotten your hopes up.
  1258.  
  1259.    But to answer some of your questions, no, it doesn't matter how you
  1260. segment things.  Segments are transparent to the programmer, although
  1261. if you know what you're doing you can fool around with placement of
  1262. files in the segment to speed up programs.  (For example, code segments
  1263. are loaded into memory one at a time.  You can "pre-load" segments that
  1264. contain frequently-used code.  You might toss code that prints a document
  1265. in a separate code segment that you don't preload, since users don't
  1266. print documents that much.  When the user does print the document, there
  1267. might be a pause as that segment is loaded from disk.)  BUT, all of this
  1268. is transparent to you.  It's all memory management magic.
  1269.  
  1270.    You'll also benefit from learning about NewPtr and NewHandle, which are
  1271. the "cool" ways of allocating memory on the Macintosh.  Lots of people have
  1272. problems with the ANSI routines.  But few people use them.  Most people
  1273. use the Mac-specific routines, and few people have problems with them.
  1274. (Huh?)  :)
  1275.  
  1276.    Don't take too much faith in this, but this is how you can allocate
  1277. structures using the Mac's NewPtr routine:  (borrowed partially from Think
  1278. Ref)
  1279.  
  1280. struct MyStruct
  1281. {
  1282.   short  tall;
  1283. }
  1284.  
  1285. struct MyStruct *myStructPtr;
  1286.  
  1287. myStructPtr = (struct myStruct *)NewPtr(sizeof(MyStruct));
  1288.  
  1289. then you can do..
  1290.  
  1291. x = myStructPtr->tall;
  1292.  
  1293.    And you'll eventually probably want to use Handles, but those can be
  1294. tricky and I won't go into them now.
  1295.  
  1296. Good luck!  (And I hope the <stdlib.h> is all you need..)
  1297.  
  1298. Scott
  1299.  
  1300. ---
  1301. M. Scott Smith    (mssmith@afterlife.ncsc.mil || umsmith@mcs.drexel.edu)
  1302.  
  1303.    Macintosh developer. Ski bum. Student.  Eater of Cadbury Creme Eggs.
  1304.  
  1305.  
  1306. ---------------------------
  1307.  
  1308. End of C.S.M.P. Digest
  1309. **********************
  1310.  
  1311.  
  1312.