From 66735a02d2c56b8677fd3db8b909888db120d46b Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 2 Jun 2021 18:27:27 +0200 Subject: [PATCH] Updated raylib syntax analysis (markdown) --- raylib-syntax-analysis.md | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/raylib-syntax-analysis.md b/raylib-syntax-analysis.md index 80e59e5..2948b88 100644 --- a/raylib-syntax-analysis.md +++ b/raylib-syntax-analysis.md @@ -126,6 +126,59 @@ PauseAudioStream(); ResumeAudioStream(); ``` +### Functions suffixes + +A part from the function prefixes that we can find in many functions names (1. common patterns), we can also find some common suffixes used by several functions: + +```c +// Suffix: *Ex() -> Used for "Extended" versions of same name functions +Vector2 GetWorldToScreenEx(); +void DrawLineEx(); +void DrawRectangleGradientEx(); +void DrawRectangleLinesEx(); +void DrawPolyLinesEx(); +Image ImageTextEx(); +void ImageDrawTextEx(); +void DrawTextureEx(); +Font LoadFontEx(); +void DrawTextEx(); +void DrawTextRecEx(); +Vector2 MeasureTextEx(); +void DrawSphereEx(); +void DrawModelEx(); +void DrawModelWiresEx(); + +// Suffix: *Pro() -> Used for "Professional" versions of same name functions, mode advanced than "Ex" +void DrawRectanglePro(); +void DrawTexturePro(); +void DrawBillboardPro(); + +// Suffix: *Rec() -> Used for functions requiring a "Rectangle" as main input parameter +void DrawRectangleRec(); +bool CheckCollisionCircleRec(); +bool CheckCollisionPointRec(); +Rectangle GetCollisionRec(); +void ImageDrawRectangleRec(); +void UpdateTextureRec(); +void DrawTextureRec(); +void DrawTextRec(); +void DrawBillboardRec(); + +// Suffix: *FromMemory() -> Used for functions loading data "from memory" instead of from files +Shader LoadShaderFromMemory(); +Image LoadImageFromMemory(); +Font LoadFontFromMemory(); +Wave LoadWaveFromMemory(); +Music LoadMusicStreamFromMemory(); + +// Suffix: *Callback() -> Used for functions setting a callback function +void SetTraceLogCallback(); +void SetLoadFileDataCallback(); +void SetSaveFileDataCallback(); +void SetLoadFileTextCallback(); +void SetSaveFileTextCallback(); +``` + ### Functions naming Most functions in raylib use a **maximum of 4 words** on its name. I think that's a good trade-off to remember the name of the function. Still, there is a small set of functions that go beyond that limit: