Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!jarthur!usc!zaphod.mps.ohio-state.edu!caen!uflorida!kluge!serss0.fiu.edu From: acmfiu@serss0.fiu.edu (ACMFIU) Newsgroups: comp.sys.apple2 Subject: off-screen grafports ... solved but more problems. Message-ID: <2585@kluge.fiu.edu> Date: 23 Feb 91 05:10:55 GMT Sender: news@kluge.fiu.edu Organization: Florida International University, Miami Lines: 54 I have finally figured out how to create and draw to off-screen grafports. However, i'm still having problems. Now, my problem is with copying the contents of my windows pixelimage to the off-screen grafport and back. here's a sample of what my code looks like: void foo (void) { GrafPort *g1, g2; LocInfo g2_locinfo = { mode640, NULL, 160, 0, 0, 200, 640 }; g1 = GetPort (); g2_locinfo.ptrToPixImage = *NewHandle (0x8000, userid, attrPage + attrLocked, NULL); OpenPort (&g2); SetPortLoc (&g2_locinfo); SetPort (&g2); PPToPort (&g1->portInfo, &g1->portInfo.boundsRect, 0, 0, modeCopy); /* i then draw to the off-screen grafport */ SetPort (g1); PPToPort (&g2.portInfo, &g2.portInfo.boundsRect, 0, 0, modeCopy); ClosePort (&g2); DisposeHandle (FindHandle (g2_locinfo.ptrToPixImage)); } now, my window which is set to the current grafport before this routine is called is created via NewWindow with bounds being { 20, 0, 200, 640 }. Now, the problem here is that after the update to the off-screen grafport is done and i draw back onto my on-screen window, the off-screen grafport's contents don't get drawn fully into the window. by that i mean i see the menu bar on the screen which also gets drawn into the window. i think this is a problem with PPToPort but i can't figure out what the problem is. if i set the coordinates of the window to { 0, 0, 200, 640 } then everything works. also, if my window is defined as before and the off-screen grafport's locinfo boundsRect is defined as { 20, 0, 200, 640 }, this doesn't work as if both off-screen/on-screen boundsRect were defined to be { 0, 0, 200, 640 }. also, the update to the screen is SLOW. i can't stand it. you can *see* the update to the window. i thought it was suppose to be *BANG*, screen update. however, this doesn't work at all. i'm getting real tired of these toolsets. right now i just want to write my own graphic routines and forget about everything else, because i want and need speed for this program. however, because this is my first venture into the toolsets (and QD is the only toolset i hate so far), i am probably doing something wrong. how can i squeeze more speed out of QD. please help, i need it. albert ps. i would like to thank Julian Pugh (he wrote GSNumerics) for his help on the off-screen grafport. Brought to you by Super Global Mega Corp .com