comparison libmlk-core/mlk/core/texture.c @ 437:e1eebc6bf25d

man: initial import
author David Demelier <markand@malikania.fr>
date Sun, 16 Oct 2022 13:21:40 +0200
parents 8f59201dc76b
children 773a082f0b91
comparison
equal deleted inserted replaced
436:df92d5b056ce 437:e1eebc6bf25d
37 tex->handle = SDL_CreateTexture(RENDERER(), 37 tex->handle = SDL_CreateTexture(RENDERER(),
38 SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, w, h); 38 SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, w, h);
39 39
40 if (!tex->handle) { 40 if (!tex->handle) {
41 tex->w = tex->h = 0; 41 tex->w = tex->h = 0;
42 return ERR_SDL; 42 return MLK_ERR_SDL;
43 } 43 }
44 44
45 tex->w = w; 45 tex->w = w;
46 tex->h = h; 46 tex->h = h;
47 47
164 assert(tex); 164 assert(tex);
165 assert(surface); 165 assert(surface);
166 166
167 if (!(tex->handle = SDL_CreateTextureFromSurface(RENDERER(), surface))) { 167 if (!(tex->handle = SDL_CreateTextureFromSurface(RENDERER(), surface))) {
168 tex->w = tex->h = 0; 168 tex->w = tex->h = 0;
169 return ERR_SDL; 169 return MLK_ERR_SDL;
170 } 170 }
171 171
172 tex->w = surface->w; 172 tex->w = surface->w;
173 tex->h = surface->h; 173 tex->h = surface->h;
174 174