Article View: comp.sys.amiga.tech
Article #11466Double Buffered Display
From: Kevin Goroway
Date: Tue, 21 Feb 1989 03:42
Date: Tue, 21 Feb 1989 03:42
60 lines
2332 bytes
2332 bytes
I hope someone can help me with this, because it is driving me crazy.
I'm trying to set up a double buffered display. It works fine, except for
one major point. My second (first) BitMap just isn't there...
InitBitMap(&b[0],DEPTH,WIDTH,HEIGHT); ;this sets up my two bitmaps
InitBitMap(&b[1],DEPTH,WIDTH,HEIGHT);
ri.BitMap=&b[0]; ;this links the first into
;my RasInfo...
vp.RasInfo=&ri; ;this links my RasInfo to my VPort
for(temp=0;temp<2;temp++) ;this allocates and clears
{ ;my two bitmaps
for(i=0;i<DEPTH;i++)
{
b[temp].Planes[i]=(PLANEPTR)AllocRaster(WIDTH,HEIGHT);
if(b[temp].Planes[i]==NULL) exit(NOT_ENOUGH_MEMORY);
}
for(i=0;i<DEPTH;i++)
{
displaymem=(UBYTE *)b[temp].Planes[i];
BltClear(displaymem,RASSIZE(WIDTH,HEIGHT),0);
}
}
InitRastPort(&rp); ;this sets up my Rastport
rp.BitMap=&b[0]; ;and points to my first Bitmap
ri.BitMap=&b[0]; ;this was done already
MakeVPort(&v,&vp); ;begin setting up Double Buffer
MrgCop(&v);
LOF[0]=v.LOFCprList;
SHF[0]=v.SHFCprList;
ri.BitMap=&b[1]; ;other bitmap
v.LOFCprList=NULL;
v.SHFCprList=NULL;
MakeVPort(&v,&vp);
MrgCop(&v);
LOF[1]=v.LOFCprList; ;ok, all done...but it doesn't work
SHF[1]=v.SHFCprList;
In a loop I say rp.Bitmap=&b[trigger], to alternate my bitmaps, but if
I set it to &b[0], to force drawing into bp[0], it doesn't display
squat, whereas &b[1] works fine...
I have tried many variations, such as setting up 2 RasInfos, setting up
two RastPorts, etc., but they all yield the same thing. No bitmap.
I am sure that my LoadView(&v) works fine. (after I swap the LOF and SHF)
So I'm stuck. any ideas?
thanks!
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| Pawn@wpi.wpi.edu Worcester Polytechnic Institute, Mass, U.S.A. |
| Pawn@wpi.Bitnet main() { printf("Hello World!\n); } |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID:
<938@wpi.wpi.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ulowell!m2c!wpi!pawnShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ulowell!m2c!wpi!pawn From: pawn@wpi.wpi.edu (Kevin Goroway) Newsgroups: comp.sys.amiga.tech,comp.sys.amiga Subject: Double Buffered Display Message-ID: <938@wpi.wpi.edu> Date: 21 Feb 89 03:42:43 GMT Organization: Worcester Polytechnic Institute, Worcester, Mass. Lines: 59