| 442 | } |
| 443 | |
| 444 | GfxResourceID Gfx_CreateTexture2(struct Bitmap* bmp, int rowWidth, cc_uint8 flags, cc_bool mipmaps) { |
| 445 | if (Gfx.NonPowTwoTexturesSupport && (flags & TEXTURE_FLAG_NONPOW2)) { |
| 446 | /* Texture is being deliberately created and can be successfully created */ |
| 447 | /* with non power of two dimensions. Typically only used for UI textures */ |
| 448 | } else if (!Math_IsPowOf2(bmp->width) || !Math_IsPowOf2(bmp->height)) { |
| 449 | Process_Abort("Textures must have power of two dimensions"); |
| 450 | } |
| 451 | |
| 452 | if (Gfx.LostContext) return 0; |
| 453 | if (!Gfx_CheckTextureSize(bmp->width, bmp->height, flags)) return 0; |
| 454 | |
| 455 | return Gfx_AllocTexture(bmp, rowWidth, flags, mipmaps); |
| 456 | } |
| 457 | |
| 458 | void Texture_Render(const struct Texture* tex) { |
| 459 | Gfx_BindTexture(tex->ID); |
no test coverage detected