diff options
| author | Ray <[email protected]> | 2015-10-24 11:19:04 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2015-10-24 11:19:04 +0200 |
| commit | 8c117cfb570874e726d6a24a4b85573e0c7b1669 (patch) | |
| tree | 310493344f775d6602461da23d553d9d1c67c2f2 /src/textures.c | |
| parent | f13b30d6060ce7541a7ef7f3074966c623128090 (diff) | |
| download | raylib-8c117cfb570874e726d6a24a4b85573e0c7b1669.tar.gz raylib-8c117cfb570874e726d6a24a4b85573e0c7b1669.zip | |
Reviewed NPOT messages and usage
Diffstat (limited to 'src/textures.c')
| -rw-r--r-- | src/textures.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/textures.c b/src/textures.c index 96653ed3..6307702f 100644 --- a/src/textures.c +++ b/src/textures.c @@ -324,10 +324,6 @@ Texture2D LoadTexture(const char *fileName) Image image = LoadImage(fileName); -#if defined(PLATFORM_WEB) - ImageToPOT(&image, BLANK); -#endif - if (image.data != NULL) { texture = LoadTextureFromImage(image); @@ -984,7 +980,19 @@ void ImageColorBrightness(Image *image, int brightness) // Generate GPU mipmaps for a texture void GenTextureMipmaps(Texture2D texture) { +#if PLATFORM_WEB + int potWidth = GetNextPOT(image->width); + int potHeight = GetNextPOT(image->height); + + // Check if texture is POT + if ((potWidth != image->width) || (potHeight != image->height)) + { + TraceLog(WARNING, "Limited NPOT support, no mipmaps available for NPOT textures"); + } + else rlglGenerateMipmaps(texture.id); +#else rlglGenerateMipmaps(texture.id); +#endif } // Draw a Texture2D |
