Inconsistencies around line width in the C API?

Hi, I'm starting to get my feet wet with v1.9.0 of the SDK, specifically the C API.

I noticed that drawEllipse has a lineWidth parameter:

void playdate->graphics->drawEllipse(
    int x, int y, int width, int height, int lineWidth, float startAngle, float endAngle, LCDColor color
);

and drawLine has a width parameter for setting the line width, different name but whatever, functions the same:

void playdate->graphics->drawLine(
    int x1, int y1, int x2, int y2, int width, LCDColor color
);

But drawRect doesn't have a parameter for line width:

void playdate->graphics->drawRect(
    int x, int y, int width, int height, LCDColor color
);

I expected the signature of drawRect to be:

void playdate->graphics->drawRect(
    int x, int y, int width, int height, int lineWidth, LCDColor color
);

to be consistent with, and have the same functionality as, drawEllipse and drawLine.

I searched for drawEllipse, drawRect, and drawLine and didn't see anyone else mentioning this.

I totally understand if this is low priority or can't be changed now due to API stability guarantees, but wanted to mention it. :heart: Thank you for the awesome platform!

Hi, good spots.

Also, did you see there's already a Rust/Playdate thing?

rtsuk/crankstart

Yes! I noticed Rob reserved the crankstart name on crates.io, but I hadn't seen the updates in the repo :slight_smile:

I'm doing my own to learn more about FFI and because I have Opinions™️, but I'll definitely be checking out crankstart if I get stuck!

2 Likes

Ouch. I don't know how we missed that one. :flushed: I'll add a new version of that function with a line width argument and deprecate the old one.

1 Like

I am mildly curious to hear more about your Opinions. Ultimately, I want to use Rust, but I might roll an architecture that is less tightly coupled to the Playdate for ease of porting to other targets. Having said that, crank and crankstart are great!