mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-31 03:09:17 -05:00
formatting
This commit is contained in:
@ -95,39 +95,38 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Draw triangle with lines
|
// Draw triangle with lines
|
||||||
rlBegin(RL_LINES);
|
rlBegin(RL_LINES);
|
||||||
// Three lines, six points
|
// Three lines, six points
|
||||||
|
// Define color for next vertex
|
||||||
|
rlColor4ub(255, 0, 0, 255);
|
||||||
|
// Define vertex
|
||||||
|
rlVertex2f(trianglePositions[0].x, trianglePositions[0].y);
|
||||||
|
rlColor4ub(0, 255, 0, 255);
|
||||||
|
rlVertex2f(trianglePositions[1].x, trianglePositions[1].y);
|
||||||
|
|
||||||
// Define color for next vertex
|
rlColor4ub(0, 255, 0, 255);
|
||||||
rlColor4ub(255, 0, 0, 255);
|
rlVertex2f(trianglePositions[1].x, trianglePositions[1].y);
|
||||||
// Define vertex
|
rlColor4ub(0, 0, 255, 255);
|
||||||
rlVertex2f(trianglePositions[0].x, trianglePositions[0].y);
|
rlVertex2f(trianglePositions[2].x, trianglePositions[2].y);
|
||||||
rlColor4ub(0, 255, 0, 255);
|
|
||||||
rlVertex2f(trianglePositions[1].x, trianglePositions[1].y);
|
|
||||||
|
|
||||||
rlColor4ub(0, 255, 0, 255);
|
rlColor4ub(0, 0, 255, 255);
|
||||||
rlVertex2f(trianglePositions[1].x, trianglePositions[1].y);
|
rlVertex2f(trianglePositions[2].x, trianglePositions[2].y);
|
||||||
rlColor4ub(0, 0, 255, 255);
|
rlColor4ub(255, 0, 0, 255);
|
||||||
rlVertex2f(trianglePositions[2].x, trianglePositions[2].y);
|
rlVertex2f(trianglePositions[0].x, trianglePositions[0].y);
|
||||||
|
|
||||||
rlColor4ub(0, 0, 255, 255);
|
|
||||||
rlVertex2f(trianglePositions[2].x, trianglePositions[2].y);
|
|
||||||
rlColor4ub(255, 0, 0, 255);
|
|
||||||
rlVertex2f(trianglePositions[0].x, trianglePositions[0].y);
|
|
||||||
rlEnd();
|
rlEnd();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Draw triangle as a triangle
|
// Draw triangle as a triangle
|
||||||
rlBegin(RL_TRIANGLES);
|
rlBegin(RL_TRIANGLES);
|
||||||
// One triangle, three points
|
// One triangle, three points
|
||||||
// Define color for next vertex
|
// Define color for next vertex
|
||||||
rlColor4ub(255, 0, 0, 255);
|
rlColor4ub(255, 0, 0, 255);
|
||||||
// Define vertex
|
// Define vertex
|
||||||
rlVertex2f(trianglePositions[0].x, trianglePositions[0].y);
|
rlVertex2f(trianglePositions[0].x, trianglePositions[0].y);
|
||||||
rlColor4ub(0, 255, 0, 255);
|
rlColor4ub(0, 255, 0, 255);
|
||||||
rlVertex2f(trianglePositions[1].x, trianglePositions[1].y);
|
rlVertex2f(trianglePositions[1].x, trianglePositions[1].y);
|
||||||
rlColor4ub(0, 0, 255, 255);
|
rlColor4ub(0, 0, 255, 255);
|
||||||
rlVertex2f(trianglePositions[2].x, trianglePositions[2].y);
|
rlVertex2f(trianglePositions[2].x, trianglePositions[2].y);
|
||||||
rlEnd();
|
rlEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user