Removed width/height parameters from LoadTexture()
Build (All) / Create test plan (push) Waiting to run
Build (All) / level1 (push) Blocked by required conditions
Build (All) / level2 (push) Blocked by required conditions

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
+1 -9
View File
@@ -72,7 +72,7 @@ char *GetResourceFilename(const char *user_specified, const char *def)
*
* If height_out is non-NULL, set it to the texture height.
*/
SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, bool transparent, int *width_out, int *height_out)
SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, bool transparent)
{
SDL_Surface *temp = NULL;
SDL_Texture *texture = NULL;
@@ -117,14 +117,6 @@ SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, bool transpar
}
}
if (width_out) {
*width_out = temp->w;
}
if (height_out) {
*height_out = temp->h;
}
texture = SDL_CreateTextureFromSurface(renderer, temp);
if (!texture) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s", SDL_GetError());