| 956 | // *********************************************************************** |
| 957 | |
| 958 | void DrawSpriteRect(sg_image image, Vec4f rect, Vec2f position) { |
| 959 | f32 w = (f32)(rect.z - rect.x); |
| 960 | f32 h = (f32)(rect.w - rect.y); |
| 961 | |
| 962 | Translate(Vec3f::Embed2D(position)); |
| 963 | |
| 964 | BindTexture(image); |
| 965 | BeginObject2D(EPrimitiveType::Triangles); |
| 966 | TexCoord(Vec2f(rect.x, rect.w)); |
| 967 | Vertex(Vec2f(0.0f, 0.0f)); |
| 968 | |
| 969 | TexCoord(Vec2f(rect.z, rect.w)); |
| 970 | Vertex(Vec2f(w, 0.0f)); |
| 971 | |
| 972 | TexCoord(Vec2f(rect.z, rect.y)); |
| 973 | Vertex(Vec2f(w, h)); |
| 974 | |
| 975 | TexCoord(Vec2f(rect.z, rect.y)); |
| 976 | Vertex(Vec2f(w, h)); |
| 977 | |
| 978 | TexCoord(Vec2f(rect.x, rect.w)); |
| 979 | Vertex(Vec2f(0.0f, 0.0f)); |
| 980 | |
| 981 | TexCoord(Vec2f(rect.x, rect.y)); |
| 982 | Vertex(Vec2f(0.f, h)); |
| 983 | EndObject2D(); |
| 984 | UnbindTexture(); |
| 985 | } |
| 986 |
no test coverage detected