[comp.sys.amiga] VSprites: Fact or Fiction?

brent@well.UUCP (01/29/87)

I'm looking for help with VSprites, and I wonder if anyone has had any luck
with them at all.  I've tried creating and moving 4 VSprites around the
display, both with a homemade View, and within the Intuition/Workbench envi-
ronment.  In both cases, I encounter no compilation or execution errors, but
I never get any VSprites.  Here is a summary of the major steps I take (using
Intuition here):

1) Declare an extern struct Custom custom.  For ON_DISPLAY & ON_SPRITE macros.
2) Open intuition.library and graphics.library.
3) Open a window on the workbench screen to get a pointer to the screen (could
   also be done by studying IntuitionBase, but this isn't important...).
4) Call InitGels() to initialize a GelsInfo structure (after reserving the
   first sprite for Intuition's use with the sprRsrvd byte).
5) Link the GelsInfo structure into the screen's RastPort.
6) Initialize the 4 VSprite structures with Height, X, Y, SprColors,
   ImageData, and VSPRITE Flag data.
7) Call AddVSprite() for each VSprite structure.
8) Loop until the window is closed, moving the VSprites together with the
   mouse by doing th following for each new mouse position (for each VSprite):
   a) Update the VSprite's X and Y members.
   b) Do an ON_DISPLAY and ON_SPRITE.  These seem optional with the WB screen.
   c) Call SortGList() and DrawGList() for the screen's RastPort and ViewPort.
   d) Call MakeScreen() for WB screen and RethinkDisplay().  (For a custom
      View I substitute MrgCop() and LoadView() here)
   e) Call WaitTOF() and even WaitBlit() for good measure.
9) When the user closes the window, call RemVSprite() for all 4 VSprites.
10) Close the window and libraries, clean up any other allocated memory.

  As I said, I get no errors with this procedure, but neither do I see any
VSprites.  I created my Sprite images with DPaint, then used GetImage to get
the data, and massaged the data into Sprite Image format.  Everything is done
as prescribed by the 1.1 developers' RKM manuals (with obvious corrections),
and by the AMIGA Programmer's Handbook, 2nd edition.  So far I've found no
examples of VSprite code which works, except for when they are used in Bobs.
I really don't see what's going wrong, but perhaps somebody has had better
luck.  If you can help me before my brain becomes Jello (R), please do!


	Thankee,

	brent

dillon@CORY.BERKELEY.EDU.UUCP (01/29/87)

	Fact, but I have no idea what you are doing wrong.  I would
suggest, however, that you use Intuition's OPENSCREEN() to create custom
screens rather than building them from scratch (as you seem to be doing).
Also, for custom screens, be sure you set the VSPRITE flag in the Screen
structure before openning.

				-Matt

brent@well.UUCP (01/31/87)

In article <8701291956.AA04589@cory.Berkeley.EDU> dillon@CORY.BERKELEY.EDU (Ma
tt Dillon) writes:
>
>	Fact, but I have no idea what you are doing wrong.  I would
>suggest, however, that you use Intuition's OPENSCREEN() to create custom
>screens rather than building them from scratch (as you seem to be doing).
>Also, for custom screens, be sure you set the VSPRITE flag in the Screen
>structure before openning.
>
>				-Matt

Matt,
  I have tried using both a homemade View, with the VSPRITE flag set in the
ViewPort (or was it View?) structure.  I have also tried using the WORKBENCH
screen, which also has the VSPRITE flag set (yes, I checked, and even forced 
it), and neither of these attacks yielded success.  Mitsu is conveying rumors
that the word may be *not* to use VSprites, but I haven't confirmed this yet.
I'd be happy to send you my code if you wanna take a gander...  :-)

	brent

billk@pnet01.CTS.COM (Bill Kelly) (02/01/87)

I missed the original question about the VSprites, (so correct me if I'm
wrong) but it seems that you are having trouble getting them to work?
If so, I know that it is definately possible to do.

I have some working code in Forth that does it.  (Allows creation of the
sprites and then lets you move them around.)

If you are NOT having trouble getting them to work, and it is something else,
I am curious as to what's happening.  If you ARE, perhaps the Forth code might
be of some help...?

Bill Kelly      {akgua, hplabs!hp-sdd, sdcsvax, nosc}!crash!pnet01!billk

(May the Forth be with you... :-)

carolyn@cbmvax.UUCP (02/03/87)

In article <2492@well.UUCP> brent@well.UUCP (Brent Southard) writes:
>
>I'm looking for help with VSprites, and I wonder if anyone has had any luck
>with them at all. ...

   Check out dbuf.gels.c in mod.sources.amiga or wherever they moved the
examples that were in there.  It does sprites and vsprites, double-buffered,
in an Intuition screen/window.  It includes alot of useful routines
to simplify gel handling. 

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Carolyn Scheppner -- CBM   >>Amiga Technical Support<<
                     UUCP  ...{allegra,caip,ihnp4,seismo}!cbmvax!carolyn 
                     PHONE 215-431-9180
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=