Updated raylib syntax analysis (markdown)

master
Ray 4 年之前
父節點
當前提交
66735a02d2
共有 1 個文件被更改,包括 53 次插入0 次删除
  1. +53
    -0
      raylib-syntax-analysis.md

+ 53
- 0
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:

Loading…
取消
儲存