On Thu, 10 Jul 2008, a_fritsch wrote:

> I read the autodocs and tested that, but as I wrote it crashed
> imediately,however.
>
> When using the Area-function, what preconditions I have to fulfill?
> What about TmpRas? They write about a TemRastport Structure. What Do I
> have to do to initialize this structure? Do I have to Alloc/Free it
> any time in the Draw-Funktion? What size do I have to alloc for my class?
>
> Why are such simple things so complicated?

I have some code snippet from Cluster's GfxDraw module.
I don't know whether this helps:

PROCEDURE AreaCircle(s : Screen;x,y,r : INTEGER);
BEGIN
   IF gfx.hires IN s^.screen^.viewPort.modes THEN
     IF gfx.lace IN s^.screen^.viewPort.modes THEN
       AreaEllipse( s, x, y, r, r )
     ELSE
       AreaEllipse( s, x, y, r*2, r )
     END
   OR_IF gfx.lace IN s^.screen^.viewPort.modes THEN
     AreaEllipse( s, x, y, r, r*2 )
   ELSE
     AreaEllipse( s, x, y, r, r );
   END;
END AreaCircle;

PROCEDURE AreaEllipse( s : Screen; x, y, a, b : INTEGER );
BEGIN
   ASSERT2( NOT gfx.AreaEllipse( s^.rastPort, x, y, a, b ), AreaEllipseFail );
   AreaEnd( s );
END AreaEllipse;


However, there is some initialization code in BasicGfx that might be 
important:

PROCEDURE OpenScreen(depth  : INTEGER;hires,lace   : BOOLEAN):ScreenPtr;
VAR p : ScreenPtr;
BEGIN
   WITH StdNewScreen AS s DO
     s.depth:=depth;
     IF hires THEN
       s.width:=640;
       IF lace THEN
         s.viewModes:=Gfx.ViewModeSet:{Gfx.hires,Gfx.lace}
       ELSE
         s.viewModes:=Gfx.ViewModeSet:{Gfx.hires}
       END
     ELSE
       s.width:=320;
       IF lace THEN
         s.viewModes:=Gfx.ViewModeSet:{Gfx.lace}
       ELSE
         s.viewModes:=Gfx.ViewModeSet:{}
       END
     END;
   END;
   New(p);
   WITH p^ DO
     p.screen:=NIL;
     p.window:=NIL;
     p.next:=FirstScreen;
     p.font:=StdFont;
     IF FirstScreen#NIL THEN
       FirstScreen^.prev:=p'PTR
     END;
     p.prev:=NIL;
     FirstScreen:=p'PTR;
     p.screen:=Intui.OpenScreen(StdNewScreen);
     IF p.screen=NIL THEN
       HALT2(-"Couldn't open Screen"'ADR);
     END;
     WITH StdNewWindow AS w DO
       w.width:=p.screen^.width;
       w.height:=p.screen^.height;
       w.screen:=p.screen
     END;
     p.window:=Intui.OpenWindow(StdNewWindow);
     IF p.window=NIL THEN
       HALT2(-"Couldn't open Window"'ADR);
     END;
(********************************************************)
     p.rastPort:=p.window^.rPort;
     Gfx.InitTmpRas(p.tmpRas,Buffer,640*512 DIV 8);
     Gfx.InitArea(p.areaInfo,p.buffer'PTR,40);
     p.rastPort^.tmpRas:=p.tmpRas'PTR;
     p.rastPort^.areaInfo:=p.areaInfo'PTR;
(********************************************************)
     Gfx.SetFont(p.rastPort,StdFont^.font);
     p.lastKey:=GfxInput.NoKey;p.lastClick:=FALSE;
   END;
   RETURN p
END OpenScreen;


------------------------------------

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/

Reply via email to