Skip to content

Instantly share code, notes, and snippets.

@raysan5
Last active December 4, 2023 12:53
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save raysan5/7c0c9fff1b6c19af24bb4a51b7383f1e to your computer and use it in GitHub Desktop.
Save raysan5/7c0c9fff1b6c19af24bb4a51b7383f1e to your computer and use it in GitHub Desktop.
raylib API usage analysis

raylib_api_usage_analysis

raylib API usage analysis

How is raylib API used out there? What are the most popular function calls? And the less used ones? What new API calls made an impact? Which ones get completely ignored by the users?

raylib has grown in the last years from 80 API functions to 475 API functions. Did the users adapted to that amount of improvements? Did the new features fit their needs?

I was looking for some answer so I decided to do a quick market analysis of raylib API usage, actually it was a nice weekend project. I decided to analyse some public GitHub projects using raylib.

How I did the analysis

Tools used:

  • fetch, a free tool to automatize GitHub repos cloning
  • Notepad++, my main code editor, with some Regex used for search and replace
  • Agent Ransack, for quick searches and data export
  • raylib_usage_analyzer.exe, a custom tool I wrote for the job

The process:

1. Get a list of repos to analyze and clone them

To get the a list of repos to analyze I decided to extract it from awesome-raylib/README.md, that list has already been curated by a raylib user and it's organized by the type of data (Gist, Bindings, Software, Examples, Tutorials...).

Another option was searching on GitHub for C repos including raylib keyword (unfortunately is not possible to search for #include "raylib.h") but it required some more work to process the data.

I decided to pick Softwares and Examples categories from awesome-raylib, copied the links into a separate text file and using some Notepad++ Regex I filtered it to get only the repos address.

2. Clone the repos locally for quick searching

The repos list was not very long (about 180 repos), considering most of them were probably small C projects, I decided to clone all them locally for a faster analysis. To do that I looked for some command-line tool that allows me to sync data from GitHub repos, after I quick search I found gget tool. Unfortunately, after a quick test I realized that tool did not allow me to download the full repo from a branch, it seems it was only intended for release artifacts. Fortunately, the same tool README listed several alternatives, one of them was fetch tool, it allows to clone a repo fom an specified branch:

fetch --repo="https://github.com/raysan5/rfxgen" --branch=master ./raysan5/rfxgen

So, I prepared a small fetch_raylib_repos.bat with multiple command-line fetch calls for every repo in the previous list. Again, I used some search and replace and some Regex to get the list quickly.

  • ISSUE 1: In the fetch call it's mandatory to specify the required branch (despite the software --help lists it as Optional) and I didn't have the main branch for all those repos, I decided to try with the two most common branch names: main and master. I decided to run the script twice, once looking for main and a second time looking for master. In case one of those was not found the fetch process just fails and next repo is tried.

  • ISSUE 2: Doing so many fetch accesses to GitHub from the same IP is not allowed so, after cloning ~40 repos, GitHub blocked my IP. Fortunately, I got a static IP so reseting the modem was a quick-and-dirty solution to relaunch the process several times.

Some repos were lost in the process (maybe by the branch name, maybe by the IP blocking...) but at the end it got ~120 repos cloned. I manually added some of my local repos with all the projects I've developed with raylib in the last years, it was ~20 additional projects for a total of ~140 projects to analyze.

3. Get a list of files to analyze

Now that I had the repos cloned I needed the list of files to scan. I decided to limit them only the .c files contained in those repos, those should be the files containing raylib API calls.

To get the list I just used Agent Ransack tool to do a search for *.c files on the required directories, I exported the list with the filename, directory, size, date, etc. as a .csv file and then I did some Regex magic on Notepad++ to get the list of files. One file per line with the complete access path. I got a list with +2000 files.

  • ISSUE 1: Some repos contained the original raylib repo so the list contained many dupplicate files. As far as there were not that many lines I just filtered them manually, removing dupplicate raylib repo references or other C library references that I knew did not include raylib API calls. After filtering I got ~720 c files to analyze.

  • ISSUE 2: I needed to re-learn some Regex, I can't remember last time I used it so it took me a while to refresh it for my needs.

4. Analyze the files -> Custom tool

The analysis process was simple, just open every file and look for the 475 possible raylib API functions usage on that file. Probably a right tool for that job would have been Python but I decided to code my own custom tool in C. Two reasons: it's been a long time since I touched some Python while C is righ now my lingua mater and second reason was speed, I had the sense that C would be faster than Python analyzing the +330K lines of code involved. Another benefit is that I could customize the output data as I want to be copy pasted in this article.

So, I just wrote a small C tool for the job, it was ~240 lines of code with comments, here the main function (not including auxiliar functions):

/**********************************************************************************************

    raylib API usage analyzer

    LICENSE: zlib/libpng

    This code is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
    BSD-like license that allows static linking with closed source software:

    Copyright (c) 2021 Ramon Santamaria (@raysan5)

**********************************************************************************************/

#include <stdlib.h>             // Required for: malloc(), calloc(), realloc(), free()
#include <stdio.h>              // Required for: printf(), fopen(), fseek(), ftell(), fread(), fclose()
#include <string.h>             // Required for: strstr() [TextFindIndex(), TextFindCount()]
#include <time.h>               // Required for: clock_t, clock(), CLOCKS_PER_SEC 

#define MAX_LINE_LENGTH   256   // Max line length for GetTextLines()

//----------------------------------------------------------------------------------
// Module Functions Declaration
//----------------------------------------------------------------------------------
static char *LoadFileText(const char *fileName, int *length);   // Load text file into buffer (Unix line-ending returned, 1 byte, '\n')
static char **GetTextLines(const char *buffer, int length, int *linesCount);    // Get separated text lines, memory must be freed manually
static int GetTextLinesCount(const char *buffer, int length);   // Get the number of lines in the text (expecting lines ending with '\n')
static int TextFindIndex(const char *text, const char *find);   // Find text index position for a provided string
static int TextFindCount(const char *text, const char *find);   // Find and count text occurrence within a string

//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
    int length = 0;
    char *buffer = LoadFileText("files_to_analize.txt", &length);

    // Get all the lines separated
    int filesCount = 0;
    char **fileNameList = GetTextLines(buffer, length, &filesCount);
    
    free(buffer);
    buffer = NULL;
    length = 0;
    
    buffer = LoadFileText("raylib_function_names.txt", &length);
    
    // Get all function names separated
    int funcNamesCount = 0;
    char **raylibFuncNames = GetTextLines(buffer, length, &funcNamesCount);
    
    free(buffer);
    buffer = NULL;
    length = 0;
    
    int *raylibFuncCounts = calloc(funcNamesCount, sizeof(int));
    
    // Let's measure time to scan files
    clock_t timeStart = clock();
    
    int totalCodeLinesToScan = 0;
    
    // Scan all files looking for raylib functions usage
    for (int i = 0; i < filesCount; i++)
    {
        //printf("Next file to scan: %s\n", fileNameList[i]);
        
        buffer = LoadFileText(fileNameList[i], &length);
        
        if ((buffer != NULL) && (length > 0))
        {
            totalCodeLinesToScan += GetTextLinesCount(buffer, length);
            
            // Count raylib functions usage
            for (int n = 0; n < funcNamesCount; n++)
            {
                int funcCount = TextFindCount(buffer, raylibFuncNames[n]);

                if (funcCount > 0)
                {
                    //printf("    [%i] Function: %s()\n", funcCount, raylibFuncNames[n]);
                    
                    // Store ocurrences count of raylibFuncNames[n]
                    raylibFuncCounts[n] += funcCount;
                }
            }
            
            free(buffer);
            buffer = NULL;
            length = 0;
        }
    }
    
    for (int i = 0; i < filesCount; i++) free(fileNameList[i]);
    free(fileNameList);
    
    clock_t timeEnd = clock();
    double timeElapsed = (double)(timeEnd - timeStart)/CLOCKS_PER_SEC;
    
    // Show surprising results!
    printf("FINAL RESULTS:\n\n");
    printf("    TOTAL FILES ANALIZED: %i\n", filesCount);
    printf("    TOTAL raylib FUNCTIONS SEARCHED: %i\n", funcNamesCount);
    printf("    TOTAL CODE LINES ANALIZED: %i\n", totalCodeLinesToScan);
    printf("    TOTAL ELAPSED TIME: %f seconds\n\n", timeElapsed);
    for (int n = 0; n < funcNamesCount; n++)
    {
        //printf("    [%i] Function: %s()\n", raylibFuncCounts[n], raylibFuncNames[n]);
        printf("| %s() | %i |\n", raylibFuncNames[n], raylibFuncCounts[n]);
    }
    
    for (int i = 0; i < funcNamesCount; i++) free(raylibFuncNames[i]);
    free(raylibFuncNames);
    free(raylibFuncCounts);

    return 0;
}

The Results

Here it comes the interesting piece of data. I divided the results by raylib modules and I just listed the raylib API functions calls really relevant. First some general data:

    TOTAL FILES ANALIZED: 719
    TOTAL raylib FUNCTIONS SEARCHED: 475
    TOTAL CODE LINES ANALIZED: 331071
    TOTAL ELAPSED TIME: 4.390000 seconds

Interesting to note that analyzing 719 code files with +330K code lines with 475 searches per file only took 4.39 seconds on a Intel(R) Core(TM) i7-3537U CPU @ 2.00GHz. It seems quite fast despite not having any kind of code optimization.

Module: core

As expected the most used calls are the raylib mandatory functions:

API function usage count
InitWindow() 491
WindowShouldClose() 478
CloseWindow() 492
ClearBackground() 554
BeginDrawing() 464
EndDrawing() 464

Some other calls used a lot are the ones included in examples and that probably most users used as a reference, from that list I was surprised by the big amount of GetRandomValue() calls. Also interesting to note that many users use GetFrameTime() to get delta time variation in a frame, this call is hardly ever used in examples.

API function usage count
SetTargetFPS() 472
GetScreenWidth() 813
GetScreenHeight() 725
GetFrameTime() 43
GetTime() 107
GetRandomValue() 1097
SetConfigFlags() 57
TraceLog() 416
SetTraceLogLevel() 24

Some windowing functions calls that catch my attention for being used more than I expected...

API function usage count
IsWindowState() 26
ToggleFullscreen() 20
SetWindowTitle() 49
SetWindowPosition() 11
SetWindowMinSize() 14
SetWindowSize() 27

...and some functions that catch my attention for being used way less than expected:

API function usage count
SetWindowMonitor() 0
GetWindowHandle() 0
GetMonitorCount() 1
GetCurrentMonitor() 0
GetMonitorPosition() 0
GetMonitorPhysicalWidth() 0
GetMonitorPhysicalHeight() 0
GetMonitorRefreshRate() 0
GetWindowPosition() 1
GetWindowScaleDPI() 0
GetMonitorName() 0

Drawing modes is an important part of raylib because they define framebuffer usage and drawing transformations. It surprises me that Mode2D is not used that much, raylib by default uses a 2D mode but BeginMode2D()/EndMode2D() allows custom camera transformations, essential for any professional 2d game. TextureMode allows changing target framebuffer to draw, it's nice to see it is used a lot, it proves it's a really useful mode. BlendMode and ScissorMode are also used but it seems VrStereoMode is not popular at all, probably because it was added quite late and not many users use raylib for VR development.

API function usage count
BeginMode2D() 10
EndMode2D() 10
BeginMode3D() 66
EndMode3D() 66
BeginTextureMode() 165
EndTextureMode() 164
BeginShaderMode() 31
EndShaderMode() 32
BeginBlendMode() 7
EndBlendMode() 7
BeginScissorMode() 10
EndScissorMode() 10
BeginVrStereoMode() 1
EndVrStereoMode() 1

Shaders is an important raylib feature and it seems it's being used a lot, despite most users just stuck to the basic calls: load the shader, get a location, set a value for the location and unload the shader. As seen in previous table, ShaderMode is also useful.

API function usage count
LoadShader() 77
LoadShaderFromMemory() 1
GetShaderLocation() 128
GetShaderLocationAttrib() 1
SetShaderValue() 118
SetShaderValueV() 1
SetShaderValueMatrix() 1
SetShaderValueTexture() 1
UnloadShader() 38

Some functions were added for more advance matrix transformation usage but most of them do not seem to be that popular:

API function usage count
GetCameraMatrix() 0
GetCameraMatrix2D() 0
GetWorldToScreen() 5
GetWorldToScreenEx() 0
GetWorldToScreen2D() 2
GetScreenToWorld2D() 8

File system functionality is quite new (callbacks system, memory data loading) and doesn't seem to be used much yet:

API function usage count
SetTraceLogCallback() 1
SetLoadFileDataCallback() 0
SetSaveFileDataCallback() 0
SetLoadFileTextCallback() 0
SetSaveFileTextCallback() 0
LoadFileData() 7
UnloadFileData() 5
SaveFileData() 2
LoadFileText() 7
UnloadFileText() 1
SaveFileText() 4

but some file utilities prove to be quite useful:

API function usage count
IsFileExtension() 274
GetFileExtension() 38
GetFileName() 128
GetFileNameWithoutExt() 34
GetDirectoryPath() 29
IsFileDropped() 32
GetDroppedFiles() 33
ClearDroppedFiles() 35

In terms of Inputs, the standard keyboard/mouse calls are the most used ones:

API function usage count
IsKeyPressed() 846
IsKeyDown() 708
IsKeyReleased() 34
IsMouseButtonPressed() 217
IsMouseButtonDown() 98
IsMouseButtonReleased() 44
GetMouseX() 56
GetMouseY() 53
GetMousePosition() 233
GetMouseWheelMove() 28

It seems gamepad/touch/gestures inputs are not used that much:

API function usage count
IsGamepadButtonPressed() 7
IsGamepadButtonDown() 54
IsGamepadButtonReleased() 0
IsGamepadButtonUp() 0
GetGamepadButtonPressed() 6
GetGamepadAxisCount() 4
GetGamepadAxisMovement() 38
GetGamepadMappings() 0
GetTouchX() 0
GetTouchY() 0
GetTouchPosition() 11
IsGestureDetected() 26

About the Camera functions, only the calls used in examples:

API function usage count
SetCameraMode() 59
UpdateCamera() 77
SetCameraPanControl() 0
SetCameraAltControl() 0
SetCameraSmoothZoomControl() 0
SetCameraMoveControls() 1

Module: shapes

The most used shapes drawing functions (+20 calls) are the following ones, interesting to note that most of the shapes functions are used several times.

API function usage count
DrawRectangle() 1607
DrawCircle() 266
DrawRectangleRec() 196
DrawRectangleLines() 160
DrawRectangleLinesEx() 49
DrawLine() 193
DrawCircleV() 76
DrawPixel() 46
DrawTriangle() 49

Shapes collision checking functions:

API function usage count
CheckCollisionRecs() 125
CheckCollisionCircles() 24
CheckCollisionCircleRec() 28
CheckCollisionPointRec() 208
CheckCollisionPointCircle() 19
CheckCollisionPointTriangle() 2
CheckCollisionLines() 0
GetCollisionRec() 4

Module: textures

As expected, the most used functions for the textures module are the ones to load image/texture/render-texture and the drawing ones:

API function usage count
LoadImage() 222
UnloadImage() 209
LoadTexture() 503
LoadTextureFromImage() 169
LoadRenderTexture() 99
UnloadTexture() 347
UnloadRenderTexture() 88
DrawTexture() 879
DrawTextureRec() 132
DrawTexturePro() 306

There are also some other functions that are used more than I expected, usually for image management:

API function usage count
ExportImage() 50
ImageFormat() 76
SetTextureFilter() 62
GenImageChecked() 19
ImageCopy() 18
ImageResize() 38
ImageColorReplace() 31
ImageDrawRectangle() 22
ImageDraw() 48
Fade() 600
GetColor() 198
GetPixelDataSize() 15

All the other functions are usually under 10 calls but most of them have been used several times.

Module: text

Personally, I consider the text module one of the most important ones in raylib, it offer a lot of functionality to deal with text and fonts. Actually, it has the most used raylib function: DrawText(). Here the most used ones:

API function usage count
DrawText() 2527
DrawTextEx() 253
MeasureText() 316
MeasureTextEx() 43
TextFormat() 655
DrawFPS() 72
LoadFont() 76
LoadFontEx() 19
UnloadFont() 53
GetFontDefault() 67

Text management functions usage, some of them seem to be quite useful:

API function usage count
TetGlyphIndex() 0
TextCopy() 18
TextIsEqual() 13
TextLength() 23
TextSubtext() 17
TextReplace() 3
TextInsert() 2
TextJoin() 11
TextSplit() 21
TextAppend() 1
TextFindIndex() 2
TextToUpper() 10
TextToLower() 4
TextToPascal() 4
TextToInteger() 56
TextToUtf8() 1

Module: models

This module offers a set of functions to draw 3d models (immediate-mode) and also generate/load meshes to be drawn as models.

Here there are the most used immediate-mode 3d drawing functions, interesting to see that the other 3d shapes are called less than 10 times and some of them are never used: DrawPoint3D(), DrawTriangle3D(), DrawTriangleStrip3D(). Does it worth to keep (and maintain) those functions?

API function usage count
DrawCube() 89
DrawCubeWires() 34
DrawSphere() 24
DrawGrid() 39

In terms of mesh generation functions, we have:

API function usage count
GenMeshPoly() 3
GenMeshPlane() 3
GenMeshCube() 27
GenMeshSphere() 6
GenMeshHemiSphere() 2
GenMeshCylinder() 6
GenMeshTorus() 7
GenMeshKnot() 2
GenMeshHeightmap() 1
GenMeshCubicmap() 13

General Model/Mesh loading and drawing functions, the most used ones (> 5 times):

API function usage count
LoadModel() 114
LoadModelFromMesh() 63
UnloadModel() 86
UploadMesh() 20
SetMaterialTexture() 17
DrawModel() 108
DrawModelEx() 14

Intersting to note that most of the functions provided by the models module API are hardly ever used...

Collisions checking functions neither seem to be used a lot...

API function usage count
CheckCollisionSpheres() 0
CheckCollisionBoxes() 8
CheckCollisionBoxSphere() 2
GetRayCollisionSphere() 1
GetRayCollisionBox() 4
GetRayCollisionModel() 2
GetRayCollisionMesh() 0
GetRayCollisionTriangle() 1
GetRayCollisionQuad() 1

Module: audio

The most used functions are the expected ones: device management and load/play sounds/music:

API function usage count
InitAudioDevice() 50
CloseAudioDevice() 42
LoadSound() 95
UnloadSound() 82
PlaySound() 154
LoadMusicStream() 41
UnloadMusicStream() 32
PlayMusicStream() 48
UpdateMusicStream() 34
StopMusicStream() 24
SetMusicVolume() 14

Note that IsAudioDeviceReady() and IsMusicStreamPlaying() functions that have never been used and raw AudioStream functionality hardly ever used.

Conclusions

  • It's interesting to see how much functionality of raylib is actually used. In general, most users just use a small fraction of the functionality provided by the library, mostly focused on 2d development for small test games and demos.

  • raylib 1.0 provided a total of 80 API functions, after 8 years of development that number has grown up to 475 API functions but it seems the most used ones still belong to that first 80-functions set that had hardly changed (in terms of signature) in 8 years.

  • Some of the new functionality that proved to be useful was the file management functionality, some image processing functions and the text management functionality.

  • A lot of work has been put in the 3d models API but it does not seem to be used a lot yet, 3d is a complex topic and dealing with it in a low-level library like raylib requires a big amount of work in comparison to a professional engine.

  • There are many functions that only a small numbers of users require and functions that bobody is using, some of those functions are user-contributed because those users required that functionality. The functions with 0 use-case worth a separate analysis to decide if they should really be in the library.

In general, I was not surprised by the results obtained. I knew the most used functions would be 2d related ones, considering that most users are probably students learning about videogames programming and using the basic features provided in the examples. Personally the most interesting part of this analysis was seeing the functions that nobody is using, those cases worth a further analysis, maybe those functions are actually not that useful for the raylib target user or they were simply added recently and not many user had time to try them.

Feel free to comment! :D

@ProfJski
Copy link

Interesting analysis. I'd recommend not pruning functionality too early. It might take some time for the code base to mature and use certain functions. I've been using RayLib on-and-off for many months now and there are still parts of its functionality I'd like to explore. The usage data might also indicate where documentation and/or examples might be beneficial to highlight functionality.

A rich set of functions also makes RayLib more attractive to adopt when someone is looking for a library. I have not yet needed to check for Ray-Sphere collisions, but I'm glad the function is there. I don't look at the API names and say to myself "That's random! Why is that there?" Your feature development seems very logical so 475 is definitely greater than 80, or even 400 in that regard.

Some examples, using the the functions you mention above as not being implemented much:

Might need a more mature code base: VR support
I've long thought that the VR support is very cool. I don't have a VR headset currently, but if I did, I'd love to see some of my 3D code in VR. Since I don't have one, however, I haven't coded for it. Even if I did have one, I would probably work on my 3D rendering on a monitor before adding in VR display. Once things looked good on a monitor, only then would I build in the VR -- once things are 90% done. If someone is making a game, etc., adoption of functions like VR might come later in the process, when the focus is on polish and porting to other platforms. Perhaps likewise Gamepad functions?

Might need some documentation: DrawTriangle3D()
I tried it once, but some triangles wouldn't render. Then I looked at the code in models.c and saw that the vertexes must be specified in counter-clockwise order. I had no idea how to sort them in this fashion, so I gave up and did something else instead. Also, counter-clockwise with respect to what? If one views the same triangle from one side, going from A to B to C, the order might be clockwise, and from the other side, it will counter-clockwise. Likewise, I find meshes and models daunting.

Might need an example: BeginMode2D
This was surprising to me, too. When I first started with RayLib I thought that all 2D drawing had to be done within BeginMode2D. Then I noticed it didn't. Sometimes old habits die hard, or old code dies hard, so I'd do some basic viewport translation and zoom without using the camera functions in BeginMode2D, e.g., for Mandelbrot or other displays. The other thing I find useful is that RayGUI can be sent to screen coordinates before drawing in BeginMode2D, which basically makes it easy for the GUI to be an "overlay" independent of what's on screen, just like it is with BeginMode3D. That makes life easy.

Might make life easy for future users.: CheckCollisionSphere()
I presume as RayLib becomes more popular, coders with less experience may constitute a larger percentage of users. For earlier adopters of RayLib, checking for sphere collision may be so easy they don't think to look for a function. "Is the distance between the centers greater than radius1+radius 2?" can be coded in one line. But if someone doesn't know that it's nice to have. Moreover, your versions of such functions are often more efficient.

You would have gotten a usage stat of 1 for DrawPoint3D from me, but the code you analyzed (3dSierpinski-IFS.cpp) still had it as a home-cooked function since I wrote it before the pull request. Maybe I should update it? :-) That said, I imagine that fewer people will use RayLib for a scatter plot than for game development, but you never know the ways it might go.

@raysan5
Copy link
Author

raysan5 commented Jul 13, 2021

@ProfJski Thank you very much for reading and commenting! No worries, no plans to prune functionality for the moment. The analysis was intended to understand usage of the library.

About VR support, I understand that feature is quite advance and most user do not require it, I implemented it because I worked with Oculus Rift for some time and it was a personal project just to understand the technology behind VR, so, I finally reviewed it and kept it inside the library. Note that is an VR simulator (basically the stereo rendering), integrating it with a real VR device would require that device SDK. In any case, it could be useful for prototyping or even custom VR devices.

About DrawTriangle3D(), that's the expected behaviour. In 3D world triangles usually require a normal vector pointing in some direction to determine the visible surface, the automatic way to define that vector is defining its vertex in a specific order, that order depends on the graphics API configuration. By default OpenGL uses counter-clock-wise order to define the normal for a triangle. There is some option to make the triangle surface visible from both sides but it's not the common approach, actually, it's more common to define two triangles using the same vertex if you want two faces.

About DrawMode2D(), by default raylib is configured for 2d mode but sometimes more advance transformations are required over the "2d camera mode", that mode allows applying those transformations using a comprehensive Camera2D object (movements, offset, zoom, rotation). Another option to do the same (but a bit more complex) could be using a RenderTexture.

About CheckCollisionSphere(), no plans to remove it. :D

Actually, I did not include the .cpp files in the analysis! I just included them and repeated the process right now, full results:

    TOTAL FILES ANALIZED: 1278
    TOTAL raylib FUNCTIONS SEARCHED: 475
    TOTAL CODE LINES ANALIZED: 423114
    TOTAL ELAPSED TIME: 5.351000 seconds
API function usage count
InitWindow() 582
WindowShouldClose() 562
CloseWindow() 568
IsWindowReady() 5
IsWindowFullscreen() 8
IsWindowHidden() 0
IsWindowMinimized() 2
IsWindowMaximized() 0
IsWindowFocused() 0
IsWindowResized() 5
IsWindowState() 26
GetWindowState() 0
ClearWindowState() 9
ToggleFullscreen() 26
MaximizeWindow() 1
MinimizeWindow() 1
RestoreWindow() 2
SetWindowIcon() 11
SetWindowTitle() 50
SetWindowPosition() 21
SetWindowMonitor() 0
SetWindowMinSize() 16
SetWindowSize() 33
GetWindowHandle() 0
GetScreenWidth() 906
GetScreenHeight() 807
GetMonitorCount() 1
GetCurrentMonitor() 0
GetMonitorPosition() 0
GetMonitorWidth() 12
GetMonitorHeight() 12
GetMonitorPhysicalWidth() 0
GetMonitorPhysicalHeight() 0
GetMonitorRefreshRate() 0
GetWindowPosition() 1
GetWindowScaleDPI() 0
GetMonitorName() 0
GetClipboardText() 7
SetClipboardText() 10
SwapScreenBuffer() 2
PollInputEvents() 35
WaitTime() 13
ShowCursor() 16
HideCursor() 16
IsCursorHidden() 3
EnableCursor() 13
DisableCursor() 10
IsCursorOnScreen() 1
ClearBackground() 663
BeginDrawing() 571
EndDrawing() 573
BeginMode2D() 18
EndMode2D() 18
BeginMode3D() 81
EndMode3D() 81
BeginTextureMode() 175
EndTextureMode() 174
BeginShaderMode() 39
EndShaderMode() 40
BeginBlendMode() 9
EndBlendMode() 9
BeginScissorMode() 17
EndScissorMode() 15
BeginVrStereoMode() 1
EndVrStereoMode() 1
LoadVrStereoConfig() 1
UnloadVrStereoConfig() 1
LoadShader() 84
LoadShaderFromMemory() 1
GetShaderLocation() 134
GetShaderLocationAttrib() 1
SetShaderValue() 131
SetShaderValueV() 1
SetShaderValueMatrix() 1
SetShaderValueTexture() 1
UnloadShader() 43
GetMouseRay() 14
GetCameraMatrix() 0
GetCameraMatrix2D() 0
GetWorldToScreen() 9
GetWorldToScreenEx() 0
GetWorldToScreen2D() 3
GetScreenToWorld2D() 13
SetTargetFPS() 562
GetFPS() 24
GetFrameTime() 101
GetTime() 114
GetRandomValue() 1230
TakeScreenshot() 3
SetConfigFlags() 77
TraceLog() 433
SetTraceLogLevel() 30
MemAlloc() 3
MemRealloc() 0
MemFree() 5
SetTraceLogCallback() 3
SetLoadFileDataCallback() 0
SetSaveFileDataCallback() 0
SetLoadFileTextCallback() 0
SetSaveFileTextCallback() 0
LoadFileData() 7
UnloadFileData() 5
SaveFileData() 2
LoadFileText() 13
UnloadFileText() 1
SaveFileText() 4
FileExists() 17
DirectoryExists() 4
IsFileExtension() 275
GetFileExtension() 38
GetFileName() 128
GetFileNameWithoutExt() 34
GetDirectoryPath() 29
GetPrevDirectoryPath() 0
GetWorkingDirectory() 7
GetDirectoryFiles() 8
ClearDirectoryFiles() 8
ChangeDirectory() 0
IsFileDropped() 35
GetDroppedFiles() 35
ClearDroppedFiles() 36
GetFileModTime() 2
CompressData() 12
DecompressData() 6
SaveStorageValue() 6
LoadStorageValue() 6
OpenURL() 0
IsKeyPressed() 958
IsKeyDown() 818
IsKeyReleased() 38
IsKeyUp() 5
SetExitKey() 31
GetKeyPressed() 18
GetCharPressed() 5
IsGamepadAvailable() 6
IsGamepadName() 5
GetGamepadName() 2
IsGamepadButtonPressed() 8
IsGamepadButtonDown() 55
IsGamepadButtonReleased() 0
IsGamepadButtonUp() 0
GetGamepadButtonPressed() 6
GetGamepadAxisCount() 4
GetGamepadAxisMovement() 47
GetGamepadMappings() 0
IsMouseButtonPressed() 246
IsMouseButtonDown() 123
IsMouseButtonReleased() 62
IsMouseButtonUp() 6
GetMouseX() 72
GetMouseY() 68
GetMousePosition() 317
GetMouseDelta() 0
SetMousePosition() 24
SetMouseOffset() 1
SetMouseScale() 9
GetMouseWheelMove() 37
SetMouseCursor() 2
GetTouchX() 1
GetTouchY() 0
GetTouchPosition() 14
SetGesturesEnabled() 1
IsGestureDetected() 26
GetGestureDetected() 10
GetTouchPointsCount() 2
GetGestureHoldDuration() 0
GetGestureDragVector() 0
GetGestureDragAngle() 0
GetGesturePinchVector() 0
GetGesturePinchAngle() 0
SetCameraMode() 68
UpdateCamera() 85
SetCameraPanControl() 0
SetCameraAltControl() 0
SetCameraSmoothZoomControl() 0
SetCameraMoveControls() 1
SetShapesTexture() 3
DrawPixel() 49
DrawPixelV() 6
DrawLine() 253
DrawLineV() 29
DrawLineEx() 14
DrawLineBezier() 3
DrawLineBezierQuad() 0
DrawLineStrip() 7
DrawCircle() 333
DrawCircleSector() 11
DrawCircleSectorLines() 5
DrawCircleGradient() 5
DrawCircleV() 81
DrawCircleLines() 29
DrawEllipse() 11
DrawEllipseLines() 3
DrawRing() 8
DrawRingLines() 4
DrawRectangle() 1832
DrawRectangleV() 17
DrawRectangleRec() 213
DrawRectanglePro() 13
DrawRectangleGradientV() 14
DrawRectangleGradientH() 5
DrawRectangleGradientEx() 4
DrawRectangleLines() 199
DrawRectangleLinesEx() 66
DrawRectangleRounded() 7
DrawRectangleRoundedLines() 4
DrawTriangle() 61
DrawTriangleLines() 3
DrawTriangleFan() 1
DrawTriangleStrip() 2
DrawPoly() 13
DrawPolyLines() 3
DrawPolyLinesEx() 1
CheckCollisionRecs() 126
CheckCollisionCircles() 24
CheckCollisionCircleRec() 34
CheckCollisionPointRec() 247
CheckCollisionPointCircle() 19
CheckCollisionPointTriangle() 2
CheckCollisionLines() 0
GetCollisionRec() 4
LoadImage() 237
LoadImageRaw() 9
LoadImageAnim() 0
LoadImageFromMemory() 1
GetTextureData() 4
GetScreenData() 3
UnloadImage() 222
ExportImage() 51
ExportImageAsCode() 7
GenImageColor() 16
GenImageGradientV() 4
GenImageGradientH() 6
GenImageGradientRadial() 4
GenImageChecked() 22
GenImageWhiteNoise() 8
GenImagePerlinNoise() 6
GenImageCellular() 4
ImageCopy() 20
ImageFromImage() 2
ImageText() 4
ImageTextEx() 1
ImageFormat() 76
ImageToPOT() 5
ImageCrop() 12
ImageAlphaCrop() 8
ImageAlphaClear() 8
ImageAlphaMask() 3
ImageAlphaPremultiply() 5
ImageResize() 38
ImageResizeNN() 11
ImageResizeCanvas() 8
ImageMipmaps() 7
ImageDither() 11
ImageFlipVertical() 13
ImageFlipHorizontal() 8
ImageRotateCW() 7
ImageRotateCCW() 4
ImageColorTint() 7
ImageColorInvert() 3
ImageColorGrayscale() 3
ImageColorContrast() 3
ImageColorBrightness() 3
ImageColorReplace() 31
LoadImageColors() 10
LoadImagePalette() 3
UnloadImageColors() 9
UnloadImagePalette() 3
GetImageAlphaBorder() 3
ImageClearBackground() 2
ImageDrawPixel() 5
ImageDrawPixelV() 2
ImageDrawLine() 4
ImageDrawLineV() 2
ImageDrawCircle() 6
ImageDrawCircleV() 2
ImageDrawRectangle() 22
ImageDrawRectangleV() 2
ImageDrawRectangleRec() 2
ImageDrawRectangleLines() 4
ImageDraw() 50
ImageDrawText() 7
ImageDrawTextEx() 5
LoadTexture() 636
LoadTextureFromImage() 185
LoadTextureCubemap() 7
LoadRenderTexture() 110
UnloadTexture() 420
UnloadRenderTexture() 97
UpdateTexture() 8
UpdateTextureRec() 1
GenTextureMipmaps() 2
SetTextureFilter() 71
SetTextureWrap() 2
DrawTexture() 971
DrawTextureV() 4
DrawTextureEx() 85
DrawTextureRec() 150
DrawTextureQuad() 10
DrawTextureTiled() 2
DrawTexturePro() 328
DrawTextureNPatch() 6
DrawTexturePoly() 1
Fade() 634
ColorToInt() 11
ColorNormalize() 2
ColorFromNormalized() 2
ColorToHSV() 4
ColorFromHSV() 8
ColorAlpha() 6
ColorAlphaBlend() 1
GetColor() 201
GetPixelColor() 9
SetPixelColor() 1
GetPixelDataSize() 15
GetFontDefault() 68
LoadFont() 83
LoadFontEx() 22
LoadFontFromImage() 1
LoadFontFromMemory() 0
LoadFontData() 6
GenImageFontAtlas() 6
UnloadFontData() 1
UnloadFont() 59
DrawFPS() 88
DrawText() 2859
DrawTextEx() 272
DrawTextRec() 5
DrawTextRecEx() 2
DrawTextCodepoint() 5
MeasureText() 349
MeasureTextEx() 43
TetGlyphIndex() 0
TextCopy() 18
TextIsEqual() 13
TextLength() 23
TextFormat() 666
TextSubtext() 17
TextReplace() 3
TextInsert() 2
TextJoin() 11
TextSplit() 21
TextAppend() 1
TextFindIndex() 2
TextToUpper() 10
TextToLower() 4
TextToPascal() 4
TextToInteger() 56
TextToUtf8() 1
LoadCodepoints() 1
UnloadCodepoints() 1
GetCodepointsCount() 3
GetCodepoint() 11
CodepointToUtf8() 1
DrawLine3D() 21
DrawPoint3D() 4
DrawCircle3D() 4
DrawTriangle3D() 0
DrawTriangleStrip3D() 0
DrawCube() 111
DrawCubeV() 11
DrawCubeWires() 41
DrawCubeWiresV() 3
DrawCubeTexture() 2
DrawSphere() 33
DrawSphereEx() 4
DrawSphereWires() 8
DrawCylinder() 16
DrawCylinderWires() 8
DrawPlane() 6
DrawRay() 6
DrawGrid() 48
LoadModel() 137
LoadModelFromMesh() 82
UnloadModel() 97
UnloadModelKeepMeshes() 0
UploadMesh() 20
UpdateMeshBuffer() 0
DrawMesh() 5
DrawMeshInstanced() 2
UnloadMesh() 5
ExportMesh() 0
LoadMaterials() 1
LoadMaterialDefault() 3
UnloadMaterial() 6
SetMaterialTexture() 19
SetModelMeshMaterial() 0
LoadModelAnimations() 3
UpdateModelAnimation() 3
UnloadModelAnimation() 3
UnloadModelAnimations() 0
IsModelAnimationValid() 0
GenMeshPoly() 3
GenMeshPlane() 3
GenMeshCube() 30
GenMeshSphere() 9
GenMeshHemiSphere() 2
GenMeshCylinder() 8
GenMeshTorus() 10
GenMeshKnot() 2
GenMeshHeightmap() 1
GenMeshCubicmap() 13
GetMeshBoundingBox() 3
GenMeshTangents() 0
GenMeshBinormals() 0
DrawModel() 127
DrawModelEx() 21
DrawModelWires() 3
DrawModelWiresEx() 0
DrawBoundingBox() 4
DrawBillboard() 6
DrawBillboardRec() 5
DrawBillboardPro() 0
CheckCollisionSpheres() 0
CheckCollisionBoxes() 8
CheckCollisionBoxSphere() 2
GetRayCollisionSphere() 1
GetRayCollisionBox() 4
GetRayCollisionModel() 2
GetRayCollisionMesh() 0
GetRayCollisionTriangle() 1
GetRayCollisionQuad() 1
InitAudioDevice() 53
CloseAudioDevice() 45
IsAudioDeviceReady() 1
SetMasterVolume() 2
LoadWave() 28
LoadWaveFromMemory() 0
LoadSound() 99
LoadSoundFromWave() 15
UpdateSound() 2
UnloadWave() 25
UnloadSound() 90
ExportWave() 13
ExportWaveAsCode() 5
PlaySound() 158
StopSound() 6
PauseSound() 2
ResumeSound() 2
PlaySoundMulti() 7
StopSoundMulti() 3
GetSoundsPlaying() 3
IsSoundPlaying() 2
SetSoundVolume() 12
SetSoundPitch() 5
WaveFormat() 5
WaveCopy() 2
WaveCrop() 1
LoadWaveSamples() 1
UnloadWaveSamples() 1
LoadMusicStream() 42
LoadMusicStreamFromMemory() 0
UnloadMusicStream() 37
PlayMusicStream() 49
IsMusicStreamPlaying() 0
UpdateMusicStream() 35
StopMusicStream() 24
PauseMusicStream() 4
ResumeMusicStream() 4
SetMusicVolume() 16
SetMusicPitch() 3
GetMusicTimeLength() 5
GetMusicTimePlayed() 5
LoadAudioStream() 2
UnloadAudioStream() 1
UpdateAudioStream() 9
IsAudioStreamProcessed() 6
PlayAudioStream() 7
PauseAudioStream() 0
ResumeAudioStream() 0
IsAudioStreamPlaying() 3
StopAudioStream() 2
SetAudioStreamVolume() 0
SetAudioStreamPitch() 0
SetAudioStreamBufferSizeDefault() 3

@mxashlynn
Copy link

Thanks for doing this analysis, I learned so e things about RayLib by reading through!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment