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

Add support for PrimitiveType::Points #438

Merged
merged 2 commits into from
May 26, 2024
Merged

Conversation

rlofc
Copy link
Contributor

@rlofc rlofc commented May 26, 2024

This will allow using PrimitiveType::Points when creating a new Material in macroquad, like so:

let material = load_material(
    ShaderSource::Glsl {
        vertex: VERTEX_SHADER,
        fragment: FRAGMENT_SHADER,
    },
    MaterialParams {
        pipeline_params: PipelineParams {
            // Added PrimitiveType::Points can be used in PipelineParams to render points rather than
            // lines or triangles.
            primitive_type: miniquad::PrimitiveType::Points,
            color_blend: Some(blend_mode),
            alpha_blend: Some(BlendState::new(
                miniquad::Equation::Add,
                miniquad::BlendFactor::Zero,
                miniquad::BlendFactor::One,
            )),
            ..Default::default()
        },
        ..Default::default()
    },
)

and is useful for various particle effects.

@rlofc rlofc changed the title Add support for GL_POINTS in PrimitiveType Add support for PrimitiveType::Points May 26, 2024
@not-fl3
Copy link
Owner

not-fl3 commented May 26, 2024

Thanks for PR!

@not-fl3 not-fl3 merged commit 8c29cfe into not-fl3:master May 26, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants