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