diff options
| author | Ray <[email protected]> | 2021-12-03 00:30:27 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-12-03 00:30:27 +0100 |
| commit | 930941e85ec4678da3bdaab992fc182e1b8500ba (patch) | |
| tree | 0fb8b157cbc4b5d6ba2b39970449d2bfd09fd3f9 /src | |
| parent | ba8c73a327281c5cb58a5b0549a198010c74b674 (diff) | |
| download | raylib-930941e85ec4678da3bdaab992fc182e1b8500ba.tar.gz raylib-930941e85ec4678da3bdaab992fc182e1b8500ba.zip | |
Added a couple of notes
Diffstat (limited to 'src')
| -rw-r--r-- | src/rtextures.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rtextures.c b/src/rtextures.c index a5e2a551..9b823378 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3112,6 +3112,7 @@ void SetTextureWrap(Texture2D texture, int wrap) { case TEXTURE_WRAP_REPEAT: { + // NOTE: It only works if NPOT textures are supported, i.e. OpenGL ES 2.0 could not support it rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_TEXTURE_WRAP_REPEAT); rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_TEXTURE_WRAP_REPEAT); } break; @@ -3173,6 +3174,8 @@ void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color // i.e tiling = { 1.0f, 1.0f } refers to all texture, offset = { 0.5f, 0.5f } moves texture origin to center void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint) { + // WARNING: This solution only works if TEXTURE_WRAP_REPEAT is supported, + // NPOT textures supported is required and OpenGL ES 2.0 could not support it Rectangle source = { offset.x*texture.width, offset.y*texture.height, tiling.x*texture.width, tiling.y*texture.height }; Vector2 origin = { 0.0f, 0.0f }; |
