defun-games / claylib

A Common Lisp 2D/3D game toolkit built on top of Raylib 4.5.
zlib License
69 stars 4 forks source link

Exposing more intermediate classes #73

Closed rvs314 closed 1 year ago

rvs314 commented 1 year ago

Why are classes like 2d-object or 2d-shape hidden? It seems like those would be useful for user-defined types. I apologize if there's an obvious reason why not to do so.

shelvick commented 1 year ago

The short answer is that Claylib has a lot of symbols, so no, I would not be surprised to find that we'd missed some.

That said, 2d-object and 2d-shape probably aren't as useful as you might think. They're mostly for internal organization, to be inherited by classes like triangle which hold fields that get passed to functions that Raylib exposes like DrawTriangle.

What are you trying to do by inheriting from 2d-object or 2d-shape that wouldn't make sense to do by inheriting from a more specific class?

rvs314 commented 1 year ago

What are you trying to do by inheriting from 2d-object or 2d-shape that wouldn't make sense to do by inheriting from a more specific class?

I want to define an abstract superclass with subclasses which are each drawn differently, but all of them must have a location, and having the superclass inherit from 2d-object seems like the way to do it (unless there's something I'm not seeing). I'm not using 2d-shape specifically, but it seems reasonable that someone would want to define a new kind of shape in terms of other primitive shapes (an irregular trapezoid in terms of triangles, etc).

shelvick commented 1 year ago

Okay, I get what you're asking now. It's the general problem of how to define a class consisting of multiple Raylib primitives. I can export 2d-object and 2d-shape, and 3d-object and 3d-shape, while I'm at it.

rvs314 commented 1 year ago

Thank you!