mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-04 08:56:26 +00:00
Added a couple of notes
This commit is contained in:
@@ -3112,6 +3112,7 @@ void SetTextureWrap(Texture2D texture, int wrap)
|
|||||||
{
|
{
|
||||||
case TEXTURE_WRAP_REPEAT:
|
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_S, RL_TEXTURE_WRAP_REPEAT);
|
||||||
rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_TEXTURE_WRAP_REPEAT);
|
rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_TEXTURE_WRAP_REPEAT);
|
||||||
} break;
|
} 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
|
// 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)
|
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 };
|
Rectangle source = { offset.x*texture.width, offset.y*texture.height, tiling.x*texture.width, tiling.y*texture.height };
|
||||||
Vector2 origin = { 0.0f, 0.0f };
|
Vector2 origin = { 0.0f, 0.0f };
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user