mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-07 11:58:12 +00:00
Removed width/height parameters from LoadTexture()
You can directly access the texture width and height now.
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user