not-fl3 / miniquad

Cross platform rendering in Rust
Apache License 2.0
1.54k stars 173 forks source link

[GL] Add support for glVertexAttribIPointer (support signed/unsigned byte, short, int attributes) #457

Closed eloraiby closed 3 months ago

eloraiby commented 3 months ago

Add support for glVertexAttribIPointer (support signed/unsigned byte, short, int attributes). Add new example that shows support for glVertexAttribIPointer (es3/webgl2/opengl 3+) but needs GLSL 150 to use OpenGL in MacOS.

not-fl3 commented 3 months ago

Thanks for PR!

I think it would be worth it to add a ContextInfo flag, maybe context.info().features.integer_attributes (not sure about the naming) and to add an explicit panic in the example if that flag is false.

With miniquad defaulting to WebGl1 on web, that flag being false is a very realistic scenario. Would be nice to have an example checking a platform-specific feature!

eloraiby commented 3 months ago

Added as an info function cap.

not-fl3 commented 3 months ago

Thanks for cleaning up those Info structs, I really like how it looks now! Thanks for PR!