Skip to content

Commit

Permalink
Added PrimitiveType::TriangleStrip
Browse files Browse the repository at this point in the history
  • Loading branch information
birhburh committed Sep 18, 2024
1 parent 76ef7ac commit d265254
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/graphics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ pub struct TextureParams {
/// On OpenGL, for a `sample_count > 1` render texture, render buffer object will
/// be created instead of a regulat texture.
///
/// The only way to use
/// The only way to use
pub sample_count: i32,
}

Expand Down Expand Up @@ -662,6 +662,7 @@ impl Default for Equation {

#[derive(Debug, PartialEq, Clone, Copy)]
pub enum PrimitiveType {
TriangleStrip,
Triangles,
Lines,
Points,
Expand All @@ -670,6 +671,7 @@ pub enum PrimitiveType {
impl From<PrimitiveType> for GLenum {
fn from(primitive_type: PrimitiveType) -> Self {
match primitive_type {
PrimitiveType::TriangleStrip => GL_TRIANGLE_STRIP,
PrimitiveType::Triangles => GL_TRIANGLES,
PrimitiveType::Lines => GL_LINES,
PrimitiveType::Points => GL_POINTS,
Expand Down Expand Up @@ -1203,7 +1205,7 @@ pub trait RenderingBackend {
/// Same as "new_render_pass", but allows multiple color attachments.
/// if `resolve_img` is set, MSAA-resolve operation will happen in `end_render_pass`
/// this operation require `color_img` to have sample_count > 1,resolve_img have
/// sample_count == 1, and color_img.len() should be equal to resolve_img.len()
/// sample_count == 1, and color_img.len() should be equal to resolve_img.len()
fn new_render_pass_mrt(
&mut self,
color_img: &[TextureId],
Expand Down
1 change: 1 addition & 0 deletions src/graphics/metal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ impl From<VertexStep> for MTLVertexStepFunction {
impl From<PrimitiveType> for MTLPrimitiveType {
fn from(primitive_type: PrimitiveType) -> Self {
match primitive_type {
PrimitiveType::TriangleStrip => MTLPrimitiveType::TriangleStrip,
PrimitiveType::Triangles => MTLPrimitiveType::Triangle,
PrimitiveType::Lines => MTLPrimitiveType::Line,
PrimitiveType::Points => MTLPrimitiveType::Point,
Expand Down

0 comments on commit d265254

Please sign in to comment.