mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
EXAMPLES: Format tweaks
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Background scrolling
|
||||
* raylib [textures] example - background scrolling
|
||||
*
|
||||
* Example complexity rating: [★☆☆☆] 1/4
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Bunnymark
|
||||
* raylib [textures] example - bunnymark
|
||||
*
|
||||
* Example complexity rating: [★★★☆] 3/4
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Draw part of the texture tiled
|
||||
* raylib [textures] example - draw texture tiled
|
||||
*
|
||||
* Example complexity rating: [★★★☆] 3/4
|
||||
*
|
||||
@ -36,7 +36,7 @@ int main(void)
|
||||
const int screenHeight = 450;
|
||||
|
||||
SetConfigFlags(FLAG_WINDOW_RESIZABLE); // Make the window resizable
|
||||
InitWindow(screenWidth, screenHeight, "raylib [textures] example - Draw part of a texture tiled");
|
||||
InitWindow(screenWidth, screenHeight, "raylib [textures] example - draw texture tiled");
|
||||
|
||||
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
||||
Texture texPattern = LoadTexture("resources/patterns.png");
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Fog of war
|
||||
* raylib [textures] example - fog of war
|
||||
*
|
||||
* Example complexity rating: [★★★☆] 3/4
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Retrive image channel (mask)
|
||||
* raylib [textures] example - extract image channel
|
||||
*
|
||||
* NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM)
|
||||
*
|
||||
@ -79,7 +79,7 @@ int main(void)
|
||||
//----------------------------------------------------------------------------------
|
||||
// TODO...
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
@ -104,6 +104,7 @@ int main(void)
|
||||
UnloadTexture(textureGreen);
|
||||
UnloadTexture(textureBlue);
|
||||
UnloadTexture(textureAlpha);
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Image loading and drawing on it
|
||||
* raylib [textures] example - image loading and drawing
|
||||
*
|
||||
* Example complexity rating: [★★☆☆] 2/4
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Procedural images generation
|
||||
* raylib [textures] example - procedural images generation
|
||||
*
|
||||
* Example complexity rating: [★★☆☆] 2/4
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Image loading and texture creation
|
||||
* raylib [textures] example - image loading and texture creation
|
||||
*
|
||||
* Example complexity rating: [★☆☆☆] 1/4
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Image Rotation
|
||||
* raylib [textures] example - image rotation
|
||||
*
|
||||
* Example complexity rating: [★★☆☆] 2/4
|
||||
*
|
||||
@ -27,7 +27,7 @@ int main(void)
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [textures] example - texture rotation");
|
||||
InitWindow(screenWidth, screenHeight, "raylib [textures] example - image rotation");
|
||||
|
||||
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
||||
Image image45 = LoadImage("resources/raylib_logo.png");
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Image text drawing using TTF generated font
|
||||
* raylib [textures] example - image text drawing using TTF generated font
|
||||
*
|
||||
* Example complexity rating: [★★☆☆] 2/4
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Texture loading and drawing
|
||||
* raylib [textures] example - texture loading and drawing
|
||||
*
|
||||
* Example complexity rating: [★☆☆☆] 1/4
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Mouse painting
|
||||
* raylib [textures] example - mouse painting
|
||||
*
|
||||
* Example complexity rating: [★★★☆] 3/4
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Draw Textured Polygon
|
||||
* raylib [textures] example - draw textured polygon
|
||||
*
|
||||
* Example complexity rating: [★☆☆☆] 1/4
|
||||
*
|
||||
@ -34,7 +34,7 @@ int main(void)
|
||||
//--------------------------------------------------------------------------------------
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [textures] example - textured polygon");
|
||||
|
||||
// Define texture coordinates to map our texture to poly
|
||||
@ -60,7 +60,7 @@ int main(void)
|
||||
points[i].x = (texcoords[i].x - 0.5f)*256.0f;
|
||||
points[i].y = (texcoords[i].y - 0.5f)*256.0f;
|
||||
}
|
||||
|
||||
|
||||
// Define the vertices drawing position
|
||||
// NOTE: Initially same as points but updated every frame
|
||||
Vector2 positions[MAX_POINTS] = { 0 };
|
||||
@ -116,7 +116,7 @@ int main(void)
|
||||
void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointCount, Color tint)
|
||||
{
|
||||
rlBegin(RL_TRIANGLES);
|
||||
|
||||
|
||||
rlSetTexture(texture.id);
|
||||
|
||||
rlColor4ub(tint.r, tint.g, tint.b, tint.a);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Load textures from raw data
|
||||
* raylib [textures] example - load textures from raw data
|
||||
*
|
||||
* Example complexity rating: [★★★☆] 3/4
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Sprite animation
|
||||
* raylib [textures] example - sprite animation
|
||||
*
|
||||
* Example complexity rating: [★★☆☆] 2/4
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Texture source and destination rectangles
|
||||
* raylib [textures] example - texture source and destination rectangles
|
||||
*
|
||||
* Example complexity rating: [★★★☆] 3/4
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Draw a texture along a segmented curve
|
||||
* raylib [textures] example - draw texture along segmented curve
|
||||
*
|
||||
* Example complexity rating: [★★★☆] 3/4
|
||||
*
|
||||
@ -112,7 +112,7 @@ int main()
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawTexturedCurve(); // Draw a textured Spline Cubic Bezier
|
||||
|
||||
|
||||
// Draw spline for reference
|
||||
if (showCurve) DrawSplineSegmentBezierCubic(curveStartPosition, curveEndPosition, curveStartPositionTangent, curveEndPositionTangent, 2, BLUE);
|
||||
|
||||
@ -120,7 +120,7 @@ int main()
|
||||
DrawLineV(curveStartPosition, curveStartPositionTangent, SKYBLUE);
|
||||
DrawLineV(curveStartPositionTangent, curveEndPositionTangent, Fade(LIGHTGRAY, 0.4f));
|
||||
DrawLineV(curveEndPosition, curveEndPositionTangent, PURPLE);
|
||||
|
||||
|
||||
if (CheckCollisionPointCircle(mouse, curveStartPosition, 6)) DrawCircleV(curveStartPosition, 7, YELLOW);
|
||||
DrawCircleV(curveStartPosition, 5, RED);
|
||||
|
||||
@ -137,7 +137,7 @@ int main()
|
||||
DrawText("Drag points to move curve, press SPACE to show/hide base curve", 10, 10, 10, DARKGRAY);
|
||||
DrawText(TextFormat("Curve width: %2.0f (Use + and - to adjust)", curveWidth), 10, 30, 10, DARKGRAY);
|
||||
DrawText(TextFormat("Curve segments: %d (Use LEFT and RIGHT to adjust)", curveSegments), 10, 50, 10, DARKGRAY);
|
||||
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
@ -145,7 +145,7 @@ int main()
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadTexture(texRoad);
|
||||
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [textures] example - Retrieve image data from texture: LoadImageFromTexture()
|
||||
* raylib [textures] example - texture to image
|
||||
*
|
||||
* Example complexity rating: [★☆☆☆] 1/4
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user