Removed width/height parameters from LoadTexture()

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

No files matched your search

+3 -4
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;
}