瀏覽代碼

REVIEWED: Text functions usage notes #4704

Ray 7 月之前
父節點
當前提交
896ff68540
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/raylib.h

+ 2 - 1
src/raylib.h

@@ -1502,7 +1502,8 @@ RLAPI int GetCodepointPrevious(const char *text, int *codepointSize);
 RLAPI const char *CodepointToUTF8(int codepoint, int *utf8Size);                            // Encode one codepoint into UTF-8 byte array (array length returned as parameter)
 
 // Text strings management functions (no UTF-8 strings, only byte chars)
-// NOTE: Some strings allocate memory internally for returned strings, just be careful!
+// WARNING 1: Most of these functions use internal static buffers, it's recommended to store returned data on user-side for re-use
+// WARNING 2: Some strings allocate memory internally for the returned strings, those strings must be free by user using MemFree()
 RLAPI int TextCopy(char *dst, const char *src);                                             // Copy one string to another, returns bytes copied
 RLAPI bool TextIsEqual(const char *text1, const char *text2);                               // Check if two text string are equal
 RLAPI unsigned int TextLength(const char *text);                                            // Get text length, checks for '\0' ending