mirror of
https://github.com/yawut/SDL.git
synced 2026-04-24 23:37:09 -05:00
Zero streaming textures to reduce confusion.
(See mailing list message with subject "Streaming textures not properly initialized?")
This commit is contained in:
parent
b898d2680a
commit
147196ba05
|
|
@ -312,7 +312,7 @@ SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int
|
|||
} else if (access == SDL_TEXTUREACCESS_STREAMING) {
|
||||
/* The pitch is 4 byte aligned */
|
||||
texture->pitch = (((w * SDL_BYTESPERPIXEL(format)) + 3) & ~3);
|
||||
texture->pixels = SDL_malloc(texture->pitch * h);
|
||||
texture->pixels = SDL_calloc(1, texture->pitch * h);
|
||||
if (!texture->pixels) {
|
||||
SDL_DestroyTexture(texture);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user