[comp.sys.amiga.tech] Novice C question

ragg0270@uxa.cso.uiuc.edu (07/30/90)

This must be simple, but I can't figure it out. (No surprise):

After reading through the RKMs, I've figured out how to:
(1) use Intuition to open windows, screens, etc.
and
(2) use exec to set up viewports, etc. and how to doubble buffer displays,
	writing to one while displaying another etc.

My question:
	How do I use double buffering and Intuition windows together?
	Is this a reasonable question or am I missing something fundamental?
	If I still use LoadView() and WaitTOF(), what do I use as the
	argument to LoadView()?

Another related question:
	I want to draw about 2000 pixels in a window. Since these points may
	be located arbitrarily anywhere in the window, the easiest way to do
	this is to use WritePixel(). But as I understand the RKMs, each
	WritePixel() occurs only after 1/60 sec., which means 2000 pixels
	takes 2000/60 = 33 secs? This doesn't seem right, but I do know 
	that WritePixel() takes longer than I would like. Is there a faster
	way to do this, short of writing directly to BitMap memory?

Thanks to all.
Richard
ragg0270@uxa.cso.uiuc.edu

vinsci@soft.fi (Leonard Norrgard) (07/31/90)

>	I want to draw about 2000 pixels in a window. Since these points may
>	be located arbitrarily anywhere in the window, the easiest way to do
>	this is to use WritePixel(). But as I understand the RKMs, each
>	WritePixel() occurs only after 1/60 sec., which means 2000 pixels
>	takes 2000/60 = 33 secs? This doesn't seem right, but I do know 
>	that WritePixel() takes longer than I would like. Is there a faster



>	way to do this, short of writing directly to BitMap memory?

  Ummm. WritePixel() shouldn't wait for anything except blits to
complete before it modifies the RastPort. This is slow enough however,
if you want to do it a number of thousand times. In addition
WritePixel() must obey clipping regions, which slows the process even
more as it clips each pixel separately (of course, it doesn't have a
choise).
  A better way would be to draw the pixels in a non-displayed
RastPort, but using your own variant of WritePixel(). Then call
ClipBlit() to copy your RastPort to a window RastPort(). Thus, you
will clip only once and writing a pixel doesn't need to wait for blits
to complete.

-- Leonard