mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-28 05:58:30 +00:00
Reviewed NPOT messages and usage
This commit is contained in:
@@ -1028,7 +1028,7 @@ void rlglInit(void)
|
|||||||
else TraceLog(WARNING, "[EXTENSION] VAO extension not found, VAO usage not supported");
|
else TraceLog(WARNING, "[EXTENSION] VAO extension not found, VAO usage not supported");
|
||||||
|
|
||||||
if (npotSupported) TraceLog(INFO, "[EXTENSION] NPOT textures extension detected, full NPOT textures supported");
|
if (npotSupported) TraceLog(INFO, "[EXTENSION] NPOT textures extension detected, full NPOT textures supported");
|
||||||
else TraceLog(WARNING, "[EXTENSION] NPOT textures extension not found, NPOT textures not supported");
|
else TraceLog(WARNING, "[EXTENSION] NPOT textures extension not found, NPOT textures support is limited (no-mipmaps, no-repeat");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (texCompDXTSupported) TraceLog(INFO, "[EXTENSION] DXT compressed textures supported");
|
if (texCompDXTSupported) TraceLog(INFO, "[EXTENSION] DXT compressed textures supported");
|
||||||
|
@@ -324,10 +324,6 @@ Texture2D LoadTexture(const char *fileName)
|
|||||||
|
|
||||||
Image image = LoadImage(fileName);
|
Image image = LoadImage(fileName);
|
||||||
|
|
||||||
#if defined(PLATFORM_WEB)
|
|
||||||
ImageToPOT(&image, BLANK);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (image.data != NULL)
|
if (image.data != NULL)
|
||||||
{
|
{
|
||||||
texture = LoadTextureFromImage(image);
|
texture = LoadTextureFromImage(image);
|
||||||
@@ -984,7 +980,19 @@ void ImageColorBrightness(Image *image, int brightness)
|
|||||||
// Generate GPU mipmaps for a texture
|
// Generate GPU mipmaps for a texture
|
||||||
void GenTextureMipmaps(Texture2D 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);
|
rlglGenerateMipmaps(texture.id);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw a Texture2D
|
// Draw a Texture2D
|
||||||
|
Reference in New Issue
Block a user