mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
Removed width/height parameters from LoadTexture()
You can directly access the texture width and height now.
This commit is contained in:
parent
dcb97a5f49
commit
efe122be4d
14 changed files with 49 additions and 70 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue