On Thu, 10 Jul 2008, a_fritsch wrote: > Hi, > thanks both so far for your support, I am currently experimenting with > the TmpRas and the Area-functions. > > > Example from RKRM: > > > > PLANEPTR myplane; > > myplane = AllocRaster(320,200); > > if (myplane == 0) exit(1); > > myRastPort.TmpRas = InitTmpRas(&myTmpRas,myplane,RASSIZE(320,200)); > > > > Ok, but there ist still something unclear to me. What size do I have > to alloc for the TmpRas? In the examples I found its always the size > of the Screen. (Like in the example above)
The size you allocate is the largest rectangle you are about to fill. So, if your ellipse is in 100 pixels tall and 100 pixels wide you should allocate 100x100 tmpras buffer. But allocating tmpras buffer which is as large as your screen is safer. > I want to use it inside a Draw method in a custom MUI class. Do I > really have to allocate a complete Screen for each MUI class that uses Not complete screen, just only one bitmap plane. > Area-functions in there Draw methods? That sounds like huge amounts of > memory!? Or can/should I just allocate/free a TmpRas of the current > size of the MUI class each time Draw is called? Can I use one TmpRas You can. > for several objects? (alloc one Screen-size TmpRas and then set its > pointer in several objects? What would I have to do when the user You can. > changes the screenmode? (and therefore the dimension/ colordepht of > the screen changes? You should free tmpras in either MUIM_Hide or MUIM_Cleanup methods. You could also free tmpras before leaving MUIM_Draw method but allocating and freeing ram causes some overhead always (especially since memory allocations are relatively expensive sometimes). > So would you sugggest to alloc/free a TmpRas of the current object > size inside the Draw method? That is the most clean way to implement it. You dont waste precious chip ram and you can minimize tmpras buffer size. But there is always small overhead to setup tmpras. Alternative method of using global tmpras is also ok. You probably should remove tmpras from rastport when leaving MUIM_Draw, though. Ilkka ------------------------------------ Visit http://www.amiga.dk/tumult for MUI-related information, especially about MUI custom classes.Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/MUI/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/MUI/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
