Re: [cc65] 3dmaze portability

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-10-18 22:33:32
On Sun, Oct 18, 2009 at 07:28:15PM +0200, Oliver Schmidt wrote:
> In general I think this is a difficult decision. AFAIK computing the
> position of the pixel at the edge of the screen is from the algo
> perspective as expensive as actually drawing the line (at least with
> Bresenham).

No, not really. Calculating the intersection between the drawn line and one of
the borders is a lot cheaper than checking the coordinates for each pixel. At
least for lines with more than just a few points. This is the reason, why the
C wrapper should do it.

> > But this is only true for lines - other
> > primitives (like circles) must do their own clipping.
>
> I see. So could you please comment on the comment below replicated
> into most drivers?

I didn't think of SetPixel. So, before I get the next thing wrong, let me say
it this way: If clipping is easy and doesn't complicate things for the driver,
it should be done in the wrapper. tgi_bar does clipping, dito tgi_setpixel and
tgi_getpixel. tgi_line *should* do clipping but doesn't.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Oct 18 22:37:01 2009

This archive was generated by hypermail 2.1.8 : 2009-10-18 22:37:02 CEST