Removed width/height parameters from LoadTexture()

You can directly access the texture width and height now.
This commit is contained in:
Sam Lantinga
2025-03-14 10:38:11 -07:00
parent dcb97a5f49
commit efe122be4d
14 changed files with 49 additions and 70 deletions

View File

@@ -718,16 +718,15 @@ static Texture *CreateTexture(const char *fname)
if (!tex) {
SDL_Log("Out of memory!");
} else {
int texw, texh;
tex->texture = LoadTexture(state->renderers[0], fname, true, &texw, &texh);
tex->texture = LoadTexture(state->renderers[0], fname, true);
if (!tex->texture) {
SDL_Log("Failed to load '%s': %s", fname, SDL_GetError());
SDL_free(tex);
return NULL;
}
SDL_SetTextureBlendMode(tex->texture, SDL_BLENDMODE_BLEND);
tex->w = (float) texw;
tex->h = (float) texh;
tex->w = (float)tex->texture->w;
tex->h = (float)tex->texture->h;
}
return tex;
}