Fix textures on draw mode switch
This commit is contained in:
parent
0573ef0382
commit
67b3766aa1
1 changed files with 8 additions and 10 deletions
|
|
@ -88,9 +88,9 @@ int main(void)
|
|||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
|
||||
DrawText("textured polygon", 20, 20, 20, DARKGRAY);
|
||||
|
||||
|
||||
DrawTexturePoly(texture, (Vector2){ GetScreenWidth()/2.0f, GetScreenHeight()/2.0f },
|
||||
positions, texcoords, MAX_POINTS, WHITE);
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ int main(void)
|
|||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -115,8 +115,7 @@ void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2
|
|||
{
|
||||
rlSetTexture(texture.id);
|
||||
|
||||
// Texturing is only supported on RL_QUADS
|
||||
rlBegin(RL_QUADS);
|
||||
rlBegin(RL_TRIANGLES);
|
||||
|
||||
rlColor4ub(tint.r, tint.g, tint.b, tint.a);
|
||||
|
||||
|
|
@ -130,9 +129,6 @@ void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2
|
|||
|
||||
rlTexCoord2f(texcoords[i + 1].x, texcoords[i + 1].y);
|
||||
rlVertex2f(points[i + 1].x + center.x, points[i + 1].y + center.y);
|
||||
|
||||
rlTexCoord2f(texcoords[i + 1].x, texcoords[i + 1].y);
|
||||
rlVertex2f(points[i + 1].x + center.x, points[i + 1].y + center.y);
|
||||
}
|
||||
rlEnd();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue