Use normalized texture coordinates

This commit is contained in:
Sylvain
2021-03-17 09:58:49 +01:00
committed by Sylvain Becker
parent 5828cc415a
commit f73c1eff10
7 changed files with 13 additions and 19 deletions

View File

@@ -3369,7 +3369,7 @@ SDL_RenderGeometry(SDL_Renderer *renderer,
if (texture) {
for (i = 0; i < num_vertices; ++i) {
if (vertices[i].tex_coord.x < 0 || vertices[i].tex_coord.y < 0 || vertices[i].tex_coord.x >= texture->w || vertices[i].tex_coord.y >= texture->h) {
if (vertices[i].tex_coord.x < 0.0f || vertices[i].tex_coord.y < 0.0f || vertices[i].tex_coord.x > 1.0f || vertices[i].tex_coord.y > 1.0f) {
return SDL_SetError("Values of 'vertices' out of bounds");
}
}