home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.atari.st.tech
- Path: sparky!uunet!gatech!destroyer!cs.ubc.ca!unixg.ubc.ca!kakwa.ucs.ualberta.ca!acs.ucalgary.ca!cpsc.ucalgary.ca!debug!Cford
- From: Cford@debug.cuc.ab.ca (Conan Ford)
- Subject: Re: Sending objc_draw to a buffer
- Reply-To: cford@debug.cuc.ab.ca
- Organization: Debug Computer Services
- Date: Fri, 25 Dec 92 19:52:33 GMT
- Message-ID: <1992Dec25.195233.1417@debug.cuc.ab.ca>
- Followup-To: comp.sys.atari.st.tech
- Keywords:
-
-
- References: <1992Dec22.130323.2260@email.tuwien.ac.at>
- Sender: Cford@Debug.cuc.ab.ca
- Lines: 62
-
- Marinos Yannikos (nino@vmars.tuwien.ac.at) wrote:
- : Cford@debug.cuc.ab.ca (Conan Ford) writes:
- : : Here's a suggestion:
- : :
- : : Set the logbase() to a 32000 byte buffer. That way all drawing will be
- : : done there but the user won't see it. After each objc_draw, use BIT_BLIT
- : : to save the drawn stuff into another buffer. After you are done, set the
- : : screen back. Make sure to hide the mouse for this.
- : : --
-
- : And if you want your program to be usable by other people than ST users
- : without graphics cards, Overscan etc., better think about that logbase()
- : and 32000 bytes buffer again...
-
- : -MY
-
-
- I should have said,"a buffer the size of the screen buffer currently
- being used." Since the logbase is the place where writes are done, the
- user will not see the objc_draw calls occuring provided that the
- physbase() is not changed.
-
- So this would be the procedure:
-
- 1. Hide mouse
-
- 2. Set the object tree so that the objects will originate at 0,0
-
- 3. Allocate a buffer the size needed by the screen plus 256 (the plus
- 256 is for old TOS versions so that you can ensure that the screen
- is on a 256 byte boundary).
-
- 4. Save current logbase value and set the logbase to the beginning of the
- buffer just allocated (be sure that it is on a 256 byte boundary).
-
- 5. Create x buffers of y size, where y is the size of the memory needed
- by each "page" when saved with BITBLT, and x is the number of
- "pages".
-
- 6. Use objc_draw to draw each "page", and then use BITBLT to save it.
-
- 7. Restore logbase() to old value.
-
- 8. Deallocate the buffer which you are using for logbase().
-
- 9. Show mouse.
-
- 10.If that doesn't work with all screens I don't know what will.
-
- N.B> It's not a good idea to use MALLOC seperately for each "page". If
- you're using C or Basic, you should be able to use arrays, and if
- you're using assembly language you will have to allocate them as
- one and set up some pointers to each "page". This is because of
- the problems GEMDOS has when you use MALLOC for more than 20
- seperate buffers (e.g. system crash :-) ).
- (Though you probably know :-) )
-
- --
- Conan Ford 1:134/9,201:5500/9,1:134/21 | Save our forests - ask for
- Cford@debug.cuc.ab.ca | plastic bags :-)
- ------------------------------------------------------------------------
- I do not represent Debug Computer Services.
-