From 20968830c0a8721c2a2d94719da5fe2cd753c114 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 18 Sep 2017 00:59:22 +0200 Subject: Added mesh generation functions --- src/textures.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/textures.c') diff --git a/src/textures.c b/src/textures.c index 9322004b..b6c90ad7 100644 --- a/src/textures.c +++ b/src/textures.c @@ -23,6 +23,9 @@ * Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... * If not defined only three image editing functions supported: ImageFormat(), ImageAlphaMask(), ImageToPOT() * +* #define SUPPORT_IMAGE_GENERATION +* Support proedural image generation functionality (gradient, spot, perlin-noise, cellular) +* * DEPENDENCIES: * stb_image - Multiple image formats loading (JPEG, PNG, BMP, TGA, PSD, GIF, PIC) * NOTE: stb_image has been slightly modified to support Android platform. @@ -56,6 +59,7 @@ #define SUPPORT_FILEFORMAT_DDS #define SUPPORT_FILEFORMAT_HDR #define SUPPORT_IMAGE_MANIPULATION +#define SUPPORT_IMAGE_GENERATION //------------------------------------------------- #include "raylib.h" @@ -1447,6 +1451,7 @@ void ImageColorBrightness(Image *image, int brightness) } #endif // SUPPORT_IMAGE_MANIPULATION +#if defined(SUPPORT_IMAGE_GENERATION) // Generate image: vertical gradient Image GenImageGradientV(int width, int height, Color top, Color bottom) { @@ -1647,6 +1652,7 @@ Image GenImageCellular(int width, int height, int tileSize) return image; } +#endif // SUPPORT_IMAGE_GENERATION // Generate GPU mipmaps for a texture void GenTextureMipmaps(Texture2D *texture) -- cgit v1.2.3 From 2068037417f44c2d86bd15e4ce6631e2faf662de Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 26 Sep 2017 00:51:26 +0200 Subject: Code tweak --- src/rlgl.c | 1 - src/textures.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src/textures.c') diff --git a/src/rlgl.c b/src/rlgl.c index 48733f79..c336ac4c 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2212,7 +2212,6 @@ void *rlReadTexturePixels(Texture2D texture) // 2 - Create an fbo, activate it, render quad with texture, glReadPixels() #define GET_TEXTURE_FBO_OPTION_1 // It works - #if defined(GET_TEXTURE_FBO_OPTION_1) glBindFramebuffer(GL_FRAMEBUFFER, fbo.id); glBindTexture(GL_TEXTURE_2D, 0); diff --git a/src/textures.c b/src/textures.c index b6c90ad7..b9fc5c19 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1068,7 +1068,7 @@ Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing Vector2 imSize = MeasureTextEx(font, text, font.baseSize, spacing); - // NOTE: GetTextureData() not available in OpenGL ES + // NOTE: glGetTexImage() not available in OpenGL ES Image imFont = GetTextureData(font.texture); ImageFormat(&imFont, UNCOMPRESSED_R8G8B8A8); // Convert to 32 bit for color tint -- cgit v1.2.3