Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh support #50

Merged
merged 7 commits into from
Jun 13, 2019
Merged

Mesh support #50

merged 7 commits into from
Jun 13, 2019

Conversation

hecrj
Copy link
Owner

@hecrj hecrj commented Jun 12, 2019

Mesh example
Watch in higher quality / Code

Fixes #4 and closes #32.

This PR introduces the Shape and Mesh types.

  • A Shape represents a geometric figure.
  • A Mesh is a set of shapes that can be drawn.

The API is quite simple!

let shape = Shape::Circle {
    center: Point::new(0.0, 0.0),
    radius: 100.0,
};

let mut mesh = Mesh::new();

mesh.stroke(shape.clone(), Color::BLACK, 2);
mesh.fill(shape, Color::WHITE);

mesh.draw(target);

@hecrj hecrj added the feature New feature or request label Jun 12, 2019
@hecrj hecrj added this to the 0.3.0 milestone Jun 12, 2019
@hecrj hecrj mentioned this pull request Jun 12, 2019
@JohnDoneth
Copy link
Contributor

Wow, this is awesome! 🎉

This is just what I wanted to use when prototyping some simple game concepts. I can see this also being useful for debug drawing for something like physics bodies.

@hecrj hecrj merged commit c31dc9f into master Jun 13, 2019
@hecrj hecrj deleted the feature/mesh branch June 14, 2019 10:04
@hecrj hecrj self-assigned this Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shape rendering support Mesh support
2 participants