Merge branch 'master' of github.com:raysan5/raylib
This commit is contained in:
commit
f59f208f4c
2
.github/workflows/webassembly.yml
vendored
2
.github/workflows/webassembly.yml
vendored
|
|
@ -29,7 +29,7 @@ jobs:
|
|||
- name: Setup emsdk
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
with:
|
||||
version: 3.1.54
|
||||
version: 3.1.64
|
||||
actions-cache-folder: 'emsdk-cache'
|
||||
|
||||
- name: Setup Release Version
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
|||
| [raylib-raku](https://github.com/vushu/raylib-raku) | **auto** | [Raku](https://www.raku.org) | Artistic License 2.0 |
|
||||
| [Raylib.lean](https://github.com/KislyjKisel/Raylib.lean) | 4.5 | [Lean4](https://lean-lang.org) | BSD-3-Clause |
|
||||
| [raylib-cobol](https://codeberg.org/glowiak/raylib-cobol) | **auto** | [COBOL](https://gnucobol.sourceforge.io) | Public domain |
|
||||
| [raylib-apl](https://github.com/Brian-ED/raylib-apl) | **5.0** | [Dyalog APL](https://www.dyalog.com/) | MIT |
|
||||
|
||||
### Utility Wrapers
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ int main(void)
|
|||
DrawRectangle(199, 199, 402, 34, LIGHTGRAY);
|
||||
for (int i = 0; i < 400; i++)
|
||||
{
|
||||
DrawLine(201 + i, 232 - (averageVolume[i] * 32), 201 + i, 232, MAROON);
|
||||
DrawLine(201 + i, 232 - (int)(averageVolume[i] * 32), 201 + i, 232, MAROON);
|
||||
}
|
||||
DrawRectangleLines(199, 199, 402, 34, GRAY);
|
||||
|
||||
|
|
|
|||
|
|
@ -157,11 +157,6 @@ int main(void)
|
|||
}
|
||||
else player.canJump = true;
|
||||
|
||||
camera.zoom += ((float)GetMouseWheelMove()*0.05f);
|
||||
|
||||
if (camera.zoom > 3.0f) camera.zoom = 3.0f;
|
||||
else if (camera.zoom < 0.25f) camera.zoom = 0.25f;
|
||||
|
||||
if (IsKeyPressed(KEY_R))
|
||||
{
|
||||
// Reset game state
|
||||
|
|
@ -176,12 +171,44 @@ int main(void)
|
|||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Events playing
|
||||
// NOTE: Logic must be before Camera update because it depends on mouse-wheel value,
|
||||
// that can be set by the played event... but some other inputs could be affected
|
||||
//----------------------------------------------------------------------------------
|
||||
if (eventPlaying)
|
||||
{
|
||||
// NOTE: Multiple events could be executed in a single frame
|
||||
while (playFrameCounter == aelist.events[currentPlayFrame].frame)
|
||||
{
|
||||
PlayAutomationEvent(aelist.events[currentPlayFrame]);
|
||||
currentPlayFrame++;
|
||||
|
||||
if (currentPlayFrame == aelist.count)
|
||||
{
|
||||
eventPlaying = false;
|
||||
currentPlayFrame = 0;
|
||||
playFrameCounter = 0;
|
||||
|
||||
TraceLog(LOG_INFO, "FINISH PLAYING!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
playFrameCounter++;
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Update camera
|
||||
//----------------------------------------------------------------------------------
|
||||
camera.target = player.position;
|
||||
camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f };
|
||||
float minX = 1000, minY = 1000, maxX = -1000, maxY = -1000;
|
||||
|
||||
// WARNING: On event replay, mouse-wheel internal value is set
|
||||
camera.zoom += ((float)GetMouseWheelMove()*0.05f);
|
||||
if (camera.zoom > 3.0f) camera.zoom = 3.0f;
|
||||
else if (camera.zoom < 0.25f) camera.zoom = 0.25f;
|
||||
|
||||
for (int i = 0; i < MAX_ENVIRONMENT_ELEMENTS; i++)
|
||||
{
|
||||
EnvElement *element = &envElements[i];
|
||||
|
|
@ -200,8 +227,8 @@ int main(void)
|
|||
if (min.y > 0) camera.offset.y = screenHeight/2 - min.y;
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Toggle events recording
|
||||
if (IsKeyPressed(KEY_S))
|
||||
// Events management
|
||||
if (IsKeyPressed(KEY_S)) // Toggle events recording
|
||||
{
|
||||
if (!eventPlaying)
|
||||
{
|
||||
|
|
@ -222,7 +249,7 @@ int main(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (IsKeyPressed(KEY_A))
|
||||
else if (IsKeyPressed(KEY_A)) // Toggle events playing (WARNING: Starts next frame)
|
||||
{
|
||||
if (!eventRecording && (aelist.count > 0))
|
||||
{
|
||||
|
|
@ -242,31 +269,6 @@ int main(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (eventPlaying)
|
||||
{
|
||||
// NOTE: Multiple events could be executed in a single frame
|
||||
while (playFrameCounter == aelist.events[currentPlayFrame].frame)
|
||||
{
|
||||
TraceLog(LOG_INFO, "PLAYING: PlayFrameCount: %i | currentPlayFrame: %i | Event Frame: %i, param: %i",
|
||||
playFrameCounter, currentPlayFrame, aelist.events[currentPlayFrame].frame, aelist.events[currentPlayFrame].params[0]);
|
||||
|
||||
PlayAutomationEvent(aelist.events[currentPlayFrame]);
|
||||
currentPlayFrame++;
|
||||
|
||||
if (currentPlayFrame == aelist.count)
|
||||
{
|
||||
eventPlaying = false;
|
||||
currentPlayFrame = 0;
|
||||
playFrameCounter = 0;
|
||||
|
||||
TraceLog(LOG_INFO, "FINISH PLAYING!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
playFrameCounter++;
|
||||
}
|
||||
|
||||
if (eventRecording || eventPlaying) frameCounter++;
|
||||
else frameCounter = 0;
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -47,25 +47,25 @@ int main(void)
|
|||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
for (int i = 0, y = 10; i < 4; i++) // MAX_GAMEPADS = 4
|
||||
for (int i = 0, y = 5; i < 4; i++) // MAX_GAMEPADS = 4
|
||||
{
|
||||
if (IsGamepadAvailable(i))
|
||||
{
|
||||
DrawText(TextFormat("Gamepad name: %s", GetGamepadName(i)), 10, y, 20, BLACK);
|
||||
y += 30;
|
||||
DrawText(TextFormat("\tAxis count: %d", GetGamepadAxisCount(i)), 10, y, 20, BLACK);
|
||||
y += 30;
|
||||
DrawText(TextFormat("Gamepad name: %s", GetGamepadName(i)), 10, y, 10, BLACK);
|
||||
y += 11;
|
||||
DrawText(TextFormat("\tAxis count: %d", GetGamepadAxisCount(i)), 10, y, 10, BLACK);
|
||||
y += 11;
|
||||
|
||||
for (int axis = 0; axis < GetGamepadAxisCount(i); axis++)
|
||||
{
|
||||
DrawText(TextFormat("\tAxis %d = %f", axis, GetGamepadAxisMovement(i, axis)), 10, y, 20, BLACK);
|
||||
y += 30;
|
||||
DrawText(TextFormat("\tAxis %d = %f", axis, GetGamepadAxisMovement(i, axis)), 10, y, 10, BLACK);
|
||||
y += 11;
|
||||
}
|
||||
|
||||
for (int button = 0; button < 32; button++)
|
||||
{
|
||||
DrawText(TextFormat("\tButton %d = %d", button, IsGamepadButtonDown(i, button)), 10, y, 20, BLACK);
|
||||
y += 30;
|
||||
DrawText(TextFormat("\tButton %d = %d", button, IsGamepadButtonDown(i, button)), 10, y, 10, BLACK);
|
||||
y += 11;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ int main(void)
|
|||
|
||||
DisableCursor(); // Limit cursor to relative movement inside the window
|
||||
|
||||
SetTargetFPS(90); // Set our game to run at 90 frames-per-second
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ int main(void)
|
|||
|
||||
EndMode3D();
|
||||
|
||||
DrawText("Move player with cursors to collide", 220, 40, 20, GRAY);
|
||||
DrawText("Move player with arrow keys to collide", 220, 40, 20, GRAY);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ int main(void)
|
|||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadModel(model); // Unload model data
|
||||
UnloadTexture(texture); // Unload texture data
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ int main()
|
|||
float emissiveIntensity = 0.01f;
|
||||
SetShaderValue(shader, emissiveIntensityLoc, &emissiveIntensity, SHADER_UNIFORM_FLOAT);
|
||||
|
||||
DrawModel(car, (Vector3){ 0.0f, 0.0f, 0.0f }, 0.005f, WHITE); // Draw car model
|
||||
DrawModel(car, (Vector3){ 0.0f, 0.0f, 0.0f }, 0.25f, WHITE); // Draw car model
|
||||
|
||||
// Draw spheres to show the lights positions
|
||||
for (int i = 0; i < MAX_LIGHTS; i++)
|
||||
|
|
|
|||
|
|
@ -164,6 +164,8 @@ int main(void)
|
|||
//--------------------------------------------------------------------------------------
|
||||
UnloadMesh(mesh); // Unload the mesh
|
||||
UnloadShader(shader); // Unload shader
|
||||
UnloadTexture(texture); // Unload texture
|
||||
UnloadTexture(light); // Unload texture
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ int main(void)
|
|||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadShader(shader);
|
||||
UnloadTexture(texture);
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ int main(void)
|
|||
//--------------------------------------------------------------------------------------
|
||||
UnloadShader(shader);
|
||||
UnloadModel(planeModel);
|
||||
UnloadTexture(perlinNoiseMap);
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -62,7 +62,7 @@ int main(void)
|
|||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawCircleV(ballPosition, (float)ballRadius, MAROON);
|
||||
//DrawText("PRESS SPACE to PAUSE BALL MOVEMENT", 10, GetScreenHeight() - 25, 20, LIGHTGRAY);
|
||||
DrawText("PRESS SPACE to PAUSE BALL MOVEMENT", 10, GetScreenHeight() - 25, 20, LIGHTGRAY);
|
||||
|
||||
// On pause, we draw a blinking message
|
||||
if (pause && ((framesCounter/30)%2)) DrawText("PAUSED", 350, 200, 30, GRAY);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ int main(void)
|
|||
|
||||
int framesCounter = 0;
|
||||
|
||||
SetTargetFPS(10); // Set our game to run at 10 frames-per-second
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ int main(void)
|
|||
DrawText(TextSubtext(message, 0, framesCounter/10), 210, 160, 20, MAROON);
|
||||
|
||||
DrawText("PRESS [ENTER] to RESTART!", 240, 260, 20, LIGHTGRAY);
|
||||
DrawText("PRESS [SPACE] to SPEED UP!", 239, 300, 20, LIGHTGRAY);
|
||||
DrawText("HOLD [SPACE] to SPEED UP!", 239, 300, 20, LIGHTGRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ int main(void)
|
|||
const int blendCountMax = 4;
|
||||
BlendMode blendMode = 0;
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ int main(void)
|
|||
textures[2] = LoadTextureFromImage(imageNeg90);
|
||||
|
||||
int currentTexture = 0;
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ int main(void)
|
|||
|
||||
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
||||
Texture2D texture = LoadTexture("resources/raylib_logo.png"); // Texture loading
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ int main(void)
|
|||
|
||||
Texture2D checked = LoadTextureFromImage(checkedIm);
|
||||
UnloadImage(checkedIm); // Unload CPU (RAM) image data (pixels)
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ int main(void)
|
|||
bool active = false;
|
||||
int framesCounter = 0;
|
||||
|
||||
SetTargetFPS(120);
|
||||
//--------------------------------------------------------------------------------------
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ int main(void)
|
|||
|
||||
texture = LoadTextureFromImage(image); // Recreate texture from retrieved image data (RAM -> VRAM)
|
||||
UnloadImage(image); // Unload retrieved image data from CPU memory (RAM)
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
|
|
|
|||
|
|
@ -5485,11 +5485,11 @@
|
|||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color1"
|
||||
"name": "inner"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color2"
|
||||
"name": "outer"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -5785,11 +5785,11 @@
|
|||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color1"
|
||||
"name": "top"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color2"
|
||||
"name": "bottom"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -5816,11 +5816,11 @@
|
|||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color1"
|
||||
"name": "left"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color2"
|
||||
"name": "right"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -5835,19 +5835,19 @@
|
|||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "col1"
|
||||
"name": "topLeft"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "col2"
|
||||
"name": "bottomLeft"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "col3"
|
||||
"name": "topRight"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "col4"
|
||||
"name": "bottomRight"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4697,8 +4697,8 @@ return {
|
|||
{type = "int", name = "centerX"},
|
||||
{type = "int", name = "centerY"},
|
||||
{type = "float", name = "radius"},
|
||||
{type = "Color", name = "color1"},
|
||||
{type = "Color", name = "color2"}
|
||||
{type = "Color", name = "inner"},
|
||||
{type = "Color", name = "outer"}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -4835,8 +4835,8 @@ return {
|
|||
{type = "int", name = "posY"},
|
||||
{type = "int", name = "width"},
|
||||
{type = "int", name = "height"},
|
||||
{type = "Color", name = "color1"},
|
||||
{type = "Color", name = "color2"}
|
||||
{type = "Color", name = "top"},
|
||||
{type = "Color", name = "bottom"}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -4848,8 +4848,8 @@ return {
|
|||
{type = "int", name = "posY"},
|
||||
{type = "int", name = "width"},
|
||||
{type = "int", name = "height"},
|
||||
{type = "Color", name = "color1"},
|
||||
{type = "Color", name = "color2"}
|
||||
{type = "Color", name = "left"},
|
||||
{type = "Color", name = "right"}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -4858,10 +4858,10 @@ return {
|
|||
returnType = "void",
|
||||
params = {
|
||||
{type = "Rectangle", name = "rec"},
|
||||
{type = "Color", name = "col1"},
|
||||
{type = "Color", name = "col2"},
|
||||
{type = "Color", name = "col3"},
|
||||
{type = "Color", name = "col4"}
|
||||
{type = "Color", name = "topLeft"},
|
||||
{type = "Color", name = "bottomLeft"},
|
||||
{type = "Color", name = "topRight"},
|
||||
{type = "Color", name = "bottomRight"}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2176,8 +2176,8 @@ Function 217: DrawCircleGradient() (5 input parameters)
|
|||
Param[1]: centerX (type: int)
|
||||
Param[2]: centerY (type: int)
|
||||
Param[3]: radius (type: float)
|
||||
Param[4]: color1 (type: Color)
|
||||
Param[5]: color2 (type: Color)
|
||||
Param[4]: inner (type: Color)
|
||||
Param[5]: outer (type: Color)
|
||||
Function 218: DrawCircleV() (3 input parameters)
|
||||
Name: DrawCircleV
|
||||
Return type: void
|
||||
|
|
@ -2278,8 +2278,8 @@ Function 229: DrawRectangleGradientV() (6 input parameters)
|
|||
Param[2]: posY (type: int)
|
||||
Param[3]: width (type: int)
|
||||
Param[4]: height (type: int)
|
||||
Param[5]: color1 (type: Color)
|
||||
Param[6]: color2 (type: Color)
|
||||
Param[5]: top (type: Color)
|
||||
Param[6]: bottom (type: Color)
|
||||
Function 230: DrawRectangleGradientH() (6 input parameters)
|
||||
Name: DrawRectangleGradientH
|
||||
Return type: void
|
||||
|
|
@ -2288,17 +2288,17 @@ Function 230: DrawRectangleGradientH() (6 input parameters)
|
|||
Param[2]: posY (type: int)
|
||||
Param[3]: width (type: int)
|
||||
Param[4]: height (type: int)
|
||||
Param[5]: color1 (type: Color)
|
||||
Param[6]: color2 (type: Color)
|
||||
Param[5]: left (type: Color)
|
||||
Param[6]: right (type: Color)
|
||||
Function 231: DrawRectangleGradientEx() (5 input parameters)
|
||||
Name: DrawRectangleGradientEx
|
||||
Return type: void
|
||||
Description: Draw a gradient-filled rectangle with custom vertex colors
|
||||
Param[1]: rec (type: Rectangle)
|
||||
Param[2]: col1 (type: Color)
|
||||
Param[3]: col2 (type: Color)
|
||||
Param[4]: col3 (type: Color)
|
||||
Param[5]: col4 (type: Color)
|
||||
Param[2]: topLeft (type: Color)
|
||||
Param[3]: bottomLeft (type: Color)
|
||||
Param[4]: topRight (type: Color)
|
||||
Param[5]: bottomRight (type: Color)
|
||||
Function 232: DrawRectangleLines() (5 input parameters)
|
||||
Name: DrawRectangleLines
|
||||
Return type: void
|
||||
|
|
|
|||
|
|
@ -1353,8 +1353,8 @@
|
|||
<Param type="int" name="centerX" desc="" />
|
||||
<Param type="int" name="centerY" desc="" />
|
||||
<Param type="float" name="radius" desc="" />
|
||||
<Param type="Color" name="color1" desc="" />
|
||||
<Param type="Color" name="color2" desc="" />
|
||||
<Param type="Color" name="inner" desc="" />
|
||||
<Param type="Color" name="outer" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawCircleV" retType="void" paramCount="3" desc="Draw a color-filled circle (Vector version)">
|
||||
<Param type="Vector2" name="center" desc="" />
|
||||
|
|
@ -1431,23 +1431,23 @@
|
|||
<Param type="int" name="posY" desc="" />
|
||||
<Param type="int" name="width" desc="" />
|
||||
<Param type="int" name="height" desc="" />
|
||||
<Param type="Color" name="color1" desc="" />
|
||||
<Param type="Color" name="color2" desc="" />
|
||||
<Param type="Color" name="top" desc="" />
|
||||
<Param type="Color" name="bottom" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawRectangleGradientH" retType="void" paramCount="6" desc="Draw a horizontal-gradient-filled rectangle">
|
||||
<Param type="int" name="posX" desc="" />
|
||||
<Param type="int" name="posY" desc="" />
|
||||
<Param type="int" name="width" desc="" />
|
||||
<Param type="int" name="height" desc="" />
|
||||
<Param type="Color" name="color1" desc="" />
|
||||
<Param type="Color" name="color2" desc="" />
|
||||
<Param type="Color" name="left" desc="" />
|
||||
<Param type="Color" name="right" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawRectangleGradientEx" retType="void" paramCount="5" desc="Draw a gradient-filled rectangle with custom vertex colors">
|
||||
<Param type="Rectangle" name="rec" desc="" />
|
||||
<Param type="Color" name="col1" desc="" />
|
||||
<Param type="Color" name="col2" desc="" />
|
||||
<Param type="Color" name="col3" desc="" />
|
||||
<Param type="Color" name="col4" desc="" />
|
||||
<Param type="Color" name="topLeft" desc="" />
|
||||
<Param type="Color" name="bottomLeft" desc="" />
|
||||
<Param type="Color" name="topRight" desc="" />
|
||||
<Param type="Color" name="bottomRight" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawRectangleLines" retType="void" paramCount="5" desc="Draw rectangle outline">
|
||||
<Param type="int" name="posX" desc="" />
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ INCLUDE_PATHS = -I.
|
|||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
||||
INCLUDE_PATHS += -Iexternal/glfw/include
|
||||
ifeq ($(PLATFORM_OS),BSD)
|
||||
INCLUDE_PATHS += -I/usr/local/include
|
||||
INCLUDE_PATHS += -I/usr/local/include -I/usr/pkg/include -I/usr/X11R7/include
|
||||
endif
|
||||
endif
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
|
||||
|
|
@ -522,7 +522,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
|
|||
LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),BSD)
|
||||
LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).$(RAYLIB_API_VERSION).so -Lsrc -L/usr/local/lib
|
||||
LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).$(RAYLIB_API_VERSION).so -Lsrc -L/usr/local/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib
|
||||
endif
|
||||
endif
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
|||
const content = try std.fs.cwd().readFileAlloc(b.allocator, file, std.math.maxInt(usize));
|
||||
defer b.allocator.free(content);
|
||||
|
||||
var lines = std.mem.split(u8, content, "\n");
|
||||
var lines = std.mem.splitScalar(u8, content, '\n');
|
||||
while (lines.next()) |line| {
|
||||
if (!std.mem.containsAtLeast(u8, line, 1, "SUPPORT")) continue;
|
||||
if (std.mem.startsWith(u8, line, "//")) continue;
|
||||
|
|
@ -149,7 +149,6 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
|||
raylib.addLibraryPath(.{ .cwd_relative = "/usr/lib" });
|
||||
raylib.addIncludePath(.{ .cwd_relative = "/usr/include" });
|
||||
if (options.linux_display_backend == .X11 or options.linux_display_backend == .Both) {
|
||||
|
||||
raylib.defineCMacro("_GLFW_X11", null);
|
||||
raylib.linkSystemLibrary("X11");
|
||||
}
|
||||
|
|
|
|||
2850
src/external/RGFW.h
vendored
2850
src/external/RGFW.h
vendored
File diff suppressed because it is too large
Load Diff
10
src/external/miniaudio.h
vendored
10
src/external/miniaudio.h
vendored
|
|
@ -36078,9 +36078,15 @@ static ma_result ma_context_get_device_info_from_fd__audio4(ma_context* pContext
|
|||
ma_uint32 channels;
|
||||
ma_uint32 sampleRate;
|
||||
|
||||
#ifdef __NetBSD__
|
||||
if (ioctl(fd, AUDIO_GETFORMAT, &fdInfo) < 0) {
|
||||
return MA_ERROR;
|
||||
}
|
||||
#else
|
||||
if (ioctl(fd, AUDIO_GETINFO, &fdInfo) < 0) {
|
||||
return MA_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (deviceType == ma_device_type_playback) {
|
||||
channels = fdInfo.play.channels;
|
||||
|
|
@ -36358,7 +36364,11 @@ static ma_result ma_device_init_fd__audio4(ma_device* pDevice, const ma_device_c
|
|||
/* We're using a default device. Get the info from the /dev/audioctl file instead of /dev/audio. */
|
||||
int fdctl = open(pDefaultDeviceCtlNames[iDefaultDevice], fdFlags, 0);
|
||||
if (fdctl != -1) {
|
||||
#ifdef __NetBSD__
|
||||
fdInfoResult = ioctl(fdctl, AUDIO_GETFORMAT, &fdInfo);
|
||||
#else
|
||||
fdInfoResult = ioctl(fdctl, AUDIO_GETINFO, &fdInfo);
|
||||
#endif
|
||||
close(fdctl);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1239,15 +1239,15 @@ int InitPlatform(void)
|
|||
// Check selection OpenGL version
|
||||
if (rlGetVersion() == RL_OPENGL_21)
|
||||
{
|
||||
RGFW_setGLVersion(2, 1);
|
||||
RGFW_setGLVersion(RGFW_GL_CORE, 2, 1);
|
||||
}
|
||||
else if (rlGetVersion() == RL_OPENGL_33)
|
||||
{
|
||||
RGFW_setGLVersion(3, 3);
|
||||
RGFW_setGLVersion(RGFW_GL_CORE, 3, 3);
|
||||
}
|
||||
else if (rlGetVersion() == RL_OPENGL_43)
|
||||
{
|
||||
RGFW_setGLVersion(4, 1);
|
||||
RGFW_setGLVersion(RGFW_GL_CORE, 4, 1);
|
||||
}
|
||||
|
||||
if (CORE.Window.flags & FLAG_MSAA_4X_HINT)
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ static void CursorEnterCallback(GLFWwindow *window, int enter);
|
|||
|
||||
// Emscripten window callback events
|
||||
static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *event, void *userData);
|
||||
static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const EmscriptenUiEvent *event, void *userData);
|
||||
// static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const EmscriptenUiEvent *event, void *userData);
|
||||
static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *event, void *userData);
|
||||
|
||||
// Emscripten input callback events
|
||||
|
|
@ -981,7 +981,7 @@ void PollInputEvents(void)
|
|||
default: break;
|
||||
}
|
||||
|
||||
if (button != -1) // Check for valid button
|
||||
if (button + 1 != 0) // Check for valid button
|
||||
{
|
||||
if (gamepadState.digitalButton[j] == 1)
|
||||
{
|
||||
|
|
@ -1572,12 +1572,12 @@ static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const Emscripte
|
|||
}
|
||||
|
||||
// Register window resize event
|
||||
static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const EmscriptenUiEvent *event, void *userData)
|
||||
{
|
||||
// TODO: Implement EmscriptenWindowResizedCallback()?
|
||||
// static EM_BOOL EmscriptenWindowResizedCallback(int eventType, const EmscriptenUiEvent *event, void *userData)
|
||||
// {
|
||||
// // TODO: Implement EmscriptenWindowResizedCallback()?
|
||||
|
||||
return 1; // The event was consumed by the callback handler
|
||||
}
|
||||
// return 1; // The event was consumed by the callback handler
|
||||
// }
|
||||
|
||||
EM_JS(int, GetWindowInnerWidth, (), { return window.innerWidth; });
|
||||
EM_JS(int, GetWindowInnerHeight, (), { return window.innerHeight; });
|
||||
|
|
@ -1593,11 +1593,11 @@ static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *
|
|||
int width = GetWindowInnerWidth();
|
||||
int height = GetWindowInnerHeight();
|
||||
|
||||
if (width < CORE.Window.screenMin.width) width = CORE.Window.screenMin.width;
|
||||
else if (width > CORE.Window.screenMax.width && CORE.Window.screenMax.width > 0) width = CORE.Window.screenMax.width;
|
||||
if (width < (int)CORE.Window.screenMin.width) width = CORE.Window.screenMin.width;
|
||||
else if (width > (int)CORE.Window.screenMax.width && CORE.Window.screenMax.width > 0) width = CORE.Window.screenMax.width;
|
||||
|
||||
if (height < CORE.Window.screenMin.height) height = CORE.Window.screenMin.height;
|
||||
else if (height > CORE.Window.screenMax.height && CORE.Window.screenMax.height > 0) height = CORE.Window.screenMax.height;
|
||||
if (height < (int)CORE.Window.screenMin.height) height = CORE.Window.screenMin.height;
|
||||
else if (height > (int)CORE.Window.screenMax.height && CORE.Window.screenMax.height > 0) height = CORE.Window.screenMax.height;
|
||||
|
||||
emscripten_set_canvas_element_size("#canvas", width, height);
|
||||
|
||||
|
|
|
|||
|
|
@ -1238,7 +1238,7 @@ RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color c
|
|||
RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle
|
||||
RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle
|
||||
RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline
|
||||
RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle
|
||||
RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color inner, Color outer); // Draw a gradient-filled circle
|
||||
RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version)
|
||||
RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline
|
||||
RLAPI void DrawCircleLinesV(Vector2 center, float radius, Color color); // Draw circle outline (Vector version)
|
||||
|
|
@ -1250,9 +1250,9 @@ RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color)
|
|||
RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version)
|
||||
RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle
|
||||
RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters
|
||||
RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle
|
||||
RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle
|
||||
RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors
|
||||
RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle
|
||||
RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle
|
||||
RLAPI void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight); // Draw a gradient-filled rectangle with custom vertex colors
|
||||
RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
|
||||
RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters
|
||||
RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges
|
||||
|
|
|
|||
|
|
@ -196,12 +196,12 @@ RLAPI Matrix GetCameraProjectionMatrix(Camera* camera, float aspect);
|
|||
//----------------------------------------------------------------------------------
|
||||
// Defines and Macros
|
||||
//----------------------------------------------------------------------------------
|
||||
#define CAMERA_MOVE_SPEED 0.09f
|
||||
#define CAMERA_MOVE_SPEED 5.4f // Units per second
|
||||
#define CAMERA_ROTATION_SPEED 0.03f
|
||||
#define CAMERA_PAN_SPEED 0.2f
|
||||
|
||||
// Camera mouse movement sensitivity
|
||||
#define CAMERA_MOUSE_MOVE_SENSITIVITY 0.003f // TODO: it should be independant of framerate
|
||||
#define CAMERA_MOUSE_MOVE_SENSITIVITY 0.003f
|
||||
|
||||
// Camera orbital speed in CAMERA_ORBITAL mode
|
||||
#define CAMERA_ORBITAL_SPEED 0.5f // Radians per second
|
||||
|
|
@ -481,10 +481,11 @@ void UpdateCamera(Camera *camera, int mode)
|
|||
}
|
||||
|
||||
// Keyboard support
|
||||
if (IsKeyDown(KEY_W)) CameraMoveForward(camera, CAMERA_MOVE_SPEED, moveInWorldPlane);
|
||||
if (IsKeyDown(KEY_A)) CameraMoveRight(camera, -CAMERA_MOVE_SPEED, moveInWorldPlane);
|
||||
if (IsKeyDown(KEY_S)) CameraMoveForward(camera, -CAMERA_MOVE_SPEED, moveInWorldPlane);
|
||||
if (IsKeyDown(KEY_D)) CameraMoveRight(camera, CAMERA_MOVE_SPEED, moveInWorldPlane);
|
||||
float cameraMoveSpeed = CAMERA_MOVE_SPEED*GetFrameTime();
|
||||
if (IsKeyDown(KEY_W)) CameraMoveForward(camera, cameraMoveSpeed, moveInWorldPlane);
|
||||
if (IsKeyDown(KEY_A)) CameraMoveRight(camera, -cameraMoveSpeed, moveInWorldPlane);
|
||||
if (IsKeyDown(KEY_S)) CameraMoveForward(camera, -cameraMoveSpeed, moveInWorldPlane);
|
||||
if (IsKeyDown(KEY_D)) CameraMoveRight(camera, cameraMoveSpeed, moveInWorldPlane);
|
||||
|
||||
// Gamepad movement
|
||||
if (IsGamepadAvailable(0))
|
||||
|
|
@ -493,16 +494,16 @@ void UpdateCamera(Camera *camera, int mode)
|
|||
CameraYaw(camera, -(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_X)*2)*CAMERA_MOUSE_MOVE_SENSITIVITY, rotateAroundTarget);
|
||||
CameraPitch(camera, -(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_Y)*2)*CAMERA_MOUSE_MOVE_SENSITIVITY, lockView, rotateAroundTarget, rotateUp);
|
||||
|
||||
if (GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y) <= -0.25f) CameraMoveForward(camera, CAMERA_MOVE_SPEED, moveInWorldPlane);
|
||||
if (GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X) <= -0.25f) CameraMoveRight(camera, -CAMERA_MOVE_SPEED, moveInWorldPlane);
|
||||
if (GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y) >= 0.25f) CameraMoveForward(camera, -CAMERA_MOVE_SPEED, moveInWorldPlane);
|
||||
if (GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X) >= 0.25f) CameraMoveRight(camera, CAMERA_MOVE_SPEED, moveInWorldPlane);
|
||||
if (GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y) <= -0.25f) CameraMoveForward(camera, cameraMoveSpeed, moveInWorldPlane);
|
||||
if (GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X) <= -0.25f) CameraMoveRight(camera, -cameraMoveSpeed, moveInWorldPlane);
|
||||
if (GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_Y) >= 0.25f) CameraMoveForward(camera, -cameraMoveSpeed, moveInWorldPlane);
|
||||
if (GetGamepadAxisMovement(0, GAMEPAD_AXIS_LEFT_X) >= 0.25f) CameraMoveRight(camera, cameraMoveSpeed, moveInWorldPlane);
|
||||
}
|
||||
|
||||
if (mode == CAMERA_FREE)
|
||||
{
|
||||
if (IsKeyDown(KEY_SPACE)) CameraMoveUp(camera, CAMERA_MOVE_SPEED);
|
||||
if (IsKeyDown(KEY_LEFT_CONTROL)) CameraMoveUp(camera, -CAMERA_MOVE_SPEED);
|
||||
if (IsKeyDown(KEY_SPACE)) CameraMoveUp(camera, cameraMoveSpeed);
|
||||
if (IsKeyDown(KEY_LEFT_CONTROL)) CameraMoveUp(camera, -cameraMoveSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
15
src/rcore.c
15
src/rcore.c
|
|
@ -367,9 +367,9 @@ static int screenshotCounter = 0; // Screenshots counter
|
|||
#endif
|
||||
|
||||
#if defined(SUPPORT_GIF_RECORDING)
|
||||
unsigned int gifFrameCounter = 0; // GIF frames counter
|
||||
bool gifRecording = false; // GIF recording state
|
||||
MsfGifState gifState = { 0 }; // MSGIF context state
|
||||
static unsigned int gifFrameCounter = 0; // GIF frames counter
|
||||
static bool gifRecording = false; // GIF recording state
|
||||
static MsfGifState gifState = { 0 }; // MSGIF context state
|
||||
#endif
|
||||
|
||||
#if defined(SUPPORT_AUTOMATION_EVENTS)
|
||||
|
|
@ -669,7 +669,6 @@ void InitWindow(int width, int height, const char *title)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
CORE.Time.frameCounter = 0;
|
||||
CORE.Window.shouldClose = false;
|
||||
|
||||
|
|
@ -2707,8 +2706,8 @@ void PlayAutomationEvent(AutomationEvent event)
|
|||
} break;
|
||||
case INPUT_MOUSE_WHEEL_MOTION: // param[0]: x delta, param[1]: y delta
|
||||
{
|
||||
CORE.Input.Mouse.currentWheelMove.x = (float)event.params[0]; break;
|
||||
CORE.Input.Mouse.currentWheelMove.y = (float)event.params[1]; break;
|
||||
CORE.Input.Mouse.currentWheelMove.x = (float)event.params[0];
|
||||
CORE.Input.Mouse.currentWheelMove.y = (float)event.params[1];
|
||||
} break;
|
||||
case INPUT_TOUCH_UP: CORE.Input.Touch.currentTouchState[event.params[0]] = false; break; // param[0]: id
|
||||
case INPUT_TOUCH_DOWN: CORE.Input.Touch.currentTouchState[event.params[0]] = true; break; // param[0]: id
|
||||
|
|
@ -2745,6 +2744,8 @@ void PlayAutomationEvent(AutomationEvent event)
|
|||
case ACTION_SETTARGETFPS: SetTargetFPS(event.params[0]); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
TRACELOG(LOG_INFO, "AUTOMATION PLAY: Frame: %i | Event type: %i | Event parameters: %i, %i, %i", event.frame, event.type, event.params[0], event.params[1], event.params[2]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -2955,7 +2956,7 @@ float GetGamepadAxisMovement(int gamepad, int axis)
|
|||
float value = (axis == GAMEPAD_AXIS_LEFT_TRIGGER || axis == GAMEPAD_AXIS_RIGHT_TRIGGER)? -1.0f : 0.0f;
|
||||
|
||||
if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (axis < MAX_GAMEPAD_AXIS)) {
|
||||
float movement = value < 0.0f ? CORE.Input.Gamepad.axisState[gamepad][axis] : fabs(CORE.Input.Gamepad.axisState[gamepad][axis]);
|
||||
float movement = value < 0.0f ? CORE.Input.Gamepad.axisState[gamepad][axis] : fabsf(CORE.Input.Gamepad.axisState[gamepad][axis]);
|
||||
|
||||
// 0.1f = GAMEPAD_AXIS_MINIMUM_DRIFT/DELTA
|
||||
if (movement > value + 0.1f) value = CORE.Input.Gamepad.axisState[gamepad][axis];
|
||||
|
|
|
|||
25
src/rlgl.h
25
src/rlgl.h
|
|
@ -3994,18 +3994,18 @@ unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode)
|
|||
unsigned int fragmentShaderId = 0;
|
||||
|
||||
// Compile vertex shader (if provided)
|
||||
// NOTE: If not vertex shader is provided, use default one
|
||||
if (vsCode != NULL) vertexShaderId = rlCompileShader(vsCode, GL_VERTEX_SHADER);
|
||||
// In case no vertex shader was provided or compilation failed, we use default vertex shader
|
||||
if (vertexShaderId == 0) vertexShaderId = RLGL.State.defaultVShaderId;
|
||||
else vertexShaderId = RLGL.State.defaultVShaderId;
|
||||
|
||||
// Compile fragment shader (if provided)
|
||||
// NOTE: If not vertex shader is provided, use default one
|
||||
if (fsCode != NULL) fragmentShaderId = rlCompileShader(fsCode, GL_FRAGMENT_SHADER);
|
||||
// In case no fragment shader was provided or compilation failed, we use default fragment shader
|
||||
if (fragmentShaderId == 0) fragmentShaderId = RLGL.State.defaultFShaderId;
|
||||
else fragmentShaderId = RLGL.State.defaultFShaderId;
|
||||
|
||||
// In case vertex and fragment shader are the default ones, no need to recompile, we can just assign the default shader program id
|
||||
if ((vertexShaderId == RLGL.State.defaultVShaderId) && (fragmentShaderId == RLGL.State.defaultFShaderId)) id = RLGL.State.defaultShaderId;
|
||||
else
|
||||
else if ((vertexShaderId > 0) && (fragmentShaderId > 0))
|
||||
{
|
||||
// One of or both shader are new, we need to compile a new shader program
|
||||
id = rlLoadShaderProgram(vertexShaderId, fragmentShaderId);
|
||||
|
|
@ -4083,6 +4083,8 @@ unsigned int rlCompileShader(const char *shaderCode, int type)
|
|||
//case GL_GEOMETRY_SHADER:
|
||||
#if defined(GRAPHICS_API_OPENGL_43)
|
||||
case GL_COMPUTE_SHADER: TRACELOG(RL_LOG_WARNING, "SHADER: [ID %i] Failed to compile compute shader code", shader); break;
|
||||
#elif defined(GRAPHICS_API_OPENGL_33)
|
||||
case GL_COMPUTE_SHADER: TRACELOG(RL_LOG_WARNING, "SHADER: Compute shaders not enabled. Define GRAPHICS_API_OPENGL_43", shader); break;
|
||||
#endif
|
||||
default: break;
|
||||
}
|
||||
|
|
@ -4098,6 +4100,8 @@ unsigned int rlCompileShader(const char *shaderCode, int type)
|
|||
TRACELOG(RL_LOG_WARNING, "SHADER: [ID %i] Compile error: %s", shader, log);
|
||||
RL_FREE(log);
|
||||
}
|
||||
|
||||
shader = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -4108,6 +4112,8 @@ unsigned int rlCompileShader(const char *shaderCode, int type)
|
|||
//case GL_GEOMETRY_SHADER:
|
||||
#if defined(GRAPHICS_API_OPENGL_43)
|
||||
case GL_COMPUTE_SHADER: TRACELOG(RL_LOG_INFO, "SHADER: [ID %i] Compute shader compiled successfully", shader); break;
|
||||
#elif defined(GRAPHICS_API_OPENGL_33)
|
||||
case GL_COMPUTE_SHADER: TRACELOG(RL_LOG_WARNING, "SHADER: Compute shaders not enabled. Define GRAPHICS_API_OPENGL_43", shader); break;
|
||||
#endif
|
||||
default: break;
|
||||
}
|
||||
|
|
@ -4348,6 +4354,8 @@ unsigned int rlLoadComputeShaderProgram(unsigned int shaderId)
|
|||
|
||||
TRACELOG(RL_LOG_INFO, "SHADER: [ID %i] Compute shader program loaded successfully", program);
|
||||
}
|
||||
#else
|
||||
TRACELOG(RL_LOG_WARNING, "SHADER: Compute shaders not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||
#endif
|
||||
|
||||
return program;
|
||||
|
|
@ -4372,6 +4380,8 @@ unsigned int rlLoadShaderBuffer(unsigned int size, const void *data, int usageHi
|
|||
glBufferData(GL_SHADER_STORAGE_BUFFER, size, data, usageHint? usageHint : RL_STREAM_COPY);
|
||||
if (data == NULL) glClearBufferData(GL_SHADER_STORAGE_BUFFER, GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, NULL); // Clear buffer data to 0
|
||||
glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
|
||||
#else
|
||||
TRACELOG(RL_LOG_WARNING, "SSBO: SSBO not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||
#endif
|
||||
|
||||
return ssbo;
|
||||
|
|
@ -4382,7 +4392,10 @@ void rlUnloadShaderBuffer(unsigned int ssboId)
|
|||
{
|
||||
#if defined(GRAPHICS_API_OPENGL_43)
|
||||
glDeleteBuffers(1, &ssboId);
|
||||
#else
|
||||
TRACELOG(RL_LOG_WARNING, "SSBO: SSBO not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// Update SSBO buffer data
|
||||
|
|
@ -4442,6 +4455,8 @@ void rlBindImageTexture(unsigned int id, unsigned int index, int format, bool re
|
|||
|
||||
rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
|
||||
glBindImageTexture(index, id, 0, 0, 0, readonly? GL_READ_ONLY : GL_READ_WRITE, glInternalFormat);
|
||||
#else
|
||||
TRACELOG(RL_LOG_WARNING, "TEXTURE: Image texture binding not enabled. Define GRAPHICS_API_OPENGL_43");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5741,11 +5741,11 @@ static bool GetPoseAtTimeGLTF(cgltf_interpolation_type interpolationType, cgltf_
|
|||
cgltf_accessor_read_float(output, 3*keyframe+1, tmp, 4);
|
||||
Vector4 v1 = {tmp[0], tmp[1], tmp[2], tmp[3]};
|
||||
cgltf_accessor_read_float(output, 3*keyframe+2, tmp, 4);
|
||||
Vector4 outTangent1 = {tmp[0], tmp[1], tmp[2]};
|
||||
Vector4 outTangent1 = {tmp[0], tmp[1], tmp[2], 0.0f};
|
||||
cgltf_accessor_read_float(output, 3*(keyframe+1)+1, tmp, 4);
|
||||
Vector4 v2 = {tmp[0], tmp[1], tmp[2], tmp[3]};
|
||||
cgltf_accessor_read_float(output, 3*(keyframe+1), tmp, 4);
|
||||
Vector4 inTangent2 = {tmp[0], tmp[1], tmp[2]};
|
||||
Vector4 inTangent2 = {tmp[0], tmp[1], tmp[2], 0.0f};
|
||||
Vector4 *r = data;
|
||||
|
||||
v1 = QuaternionNormalize(v1);
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@
|
|||
//----------------------------------------------------------------------------------
|
||||
// Global Variables Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
Texture2D texShapes = { 1, 1, 1, 1, 7 }; // Texture used on shapes drawing (white pixel loaded by rlgl)
|
||||
Rectangle texShapesRec = { 0.0f, 0.0f, 1.0f, 1.0f }; // Texture source rectangle used on shapes drawing
|
||||
static Texture2D texShapes = { 1, 1, 1, 1, 7 }; // Texture used on shapes drawing (white pixel loaded by rlgl)
|
||||
static Rectangle texShapesRec = { 0.0f, 0.0f, 1.0f, 1.0f }; // Texture source rectangle used on shapes drawing
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Module specific Functions Declaration
|
||||
|
|
@ -430,17 +430,16 @@ void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float
|
|||
}
|
||||
|
||||
// Draw a gradient-filled circle
|
||||
// NOTE: Gradient goes from center (color1) to border (color2)
|
||||
void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2)
|
||||
void DrawCircleGradient(int centerX, int centerY, float radius, Color inner, Color outer)
|
||||
{
|
||||
rlBegin(RL_TRIANGLES);
|
||||
for (int i = 0; i < 360; i += 10)
|
||||
{
|
||||
rlColor4ub(color1.r, color1.g, color1.b, color1.a);
|
||||
rlColor4ub(inner.r, inner.g, inner.b, inner.a);
|
||||
rlVertex2f((float)centerX, (float)centerY);
|
||||
rlColor4ub(color2.r, color2.g, color2.b, color2.a);
|
||||
rlColor4ub(outer.r, outer.g, outer.b, outer.a);
|
||||
rlVertex2f((float)centerX + cosf(DEG2RAD*(i + 10))*radius, (float)centerY + sinf(DEG2RAD*(i + 10))*radius);
|
||||
rlColor4ub(color2.r, color2.g, color2.b, color2.a);
|
||||
rlColor4ub(outer.r, outer.g, outer.b, outer.a);
|
||||
rlVertex2f((float)centerX + cosf(DEG2RAD*i)*radius, (float)centerY + sinf(DEG2RAD*i)*radius);
|
||||
}
|
||||
rlEnd();
|
||||
|
|
@ -761,22 +760,19 @@ void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color
|
|||
}
|
||||
|
||||
// Draw a vertical-gradient-filled rectangle
|
||||
// NOTE: Gradient goes from bottom (color1) to top (color2)
|
||||
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2)
|
||||
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom)
|
||||
{
|
||||
DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, color1, color2, color2, color1);
|
||||
DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, top, bottom, bottom, top);
|
||||
}
|
||||
|
||||
// Draw a horizontal-gradient-filled rectangle
|
||||
// NOTE: Gradient goes from bottom (color1) to top (color2)
|
||||
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2)
|
||||
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right)
|
||||
{
|
||||
DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, color1, color1, color2, color2);
|
||||
DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, left, left, right, right);
|
||||
}
|
||||
|
||||
// Draw a gradient-filled rectangle
|
||||
// NOTE: Colors refer to corners, starting at top-lef corner and counter-clockwise
|
||||
void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4)
|
||||
void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight)
|
||||
{
|
||||
rlSetTexture(GetShapesTexture().id);
|
||||
Rectangle shapeRect = GetShapesTextureRectangle();
|
||||
|
|
@ -785,19 +781,19 @@ void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3,
|
|||
rlNormal3f(0.0f, 0.0f, 1.0f);
|
||||
|
||||
// NOTE: Default raylib font character 95 is a white square
|
||||
rlColor4ub(col1.r, col1.g, col1.b, col1.a);
|
||||
rlColor4ub(topLeft.r, topLeft.g, topLeft.b, topLeft.a);
|
||||
rlTexCoord2f(shapeRect.x/texShapes.width, shapeRect.y/texShapes.height);
|
||||
rlVertex2f(rec.x, rec.y);
|
||||
|
||||
rlColor4ub(col2.r, col2.g, col2.b, col2.a);
|
||||
rlColor4ub(bottomLeft.r, bottomLeft.g, bottomLeft.b, bottomLeft.a);
|
||||
rlTexCoord2f(shapeRect.x/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
||||
rlVertex2f(rec.x, rec.y + rec.height);
|
||||
|
||||
rlColor4ub(col3.r, col3.g, col3.b, col3.a);
|
||||
rlColor4ub(topRight.r, topRight.g, topRight.b, topRight.a);
|
||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, (shapeRect.y + shapeRect.height)/texShapes.height);
|
||||
rlVertex2f(rec.x + rec.width, rec.y + rec.height);
|
||||
|
||||
rlColor4ub(col4.r, col4.g, col4.b, col4.a);
|
||||
rlColor4ub(bottomRight.r, bottomRight.g, bottomRight.b, bottomRight.a);
|
||||
rlTexCoord2f((shapeRect.x + shapeRect.width)/texShapes.width, shapeRect.y/texShapes.height);
|
||||
rlVertex2f(rec.x + rec.width, rec.y);
|
||||
rlEnd();
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ Image LoadImageSvg(const char *fileNameOrString, int width, int height)
|
|||
|
||||
if (isSvgStringValid)
|
||||
{
|
||||
struct NSVGimage *svgImage = nsvgParse(fileData, "px", 96.0f);
|
||||
struct NSVGimage *svgImage = nsvgParse((char *)fileData, "px", 96.0f);
|
||||
|
||||
unsigned char *img = RL_MALLOC(width*height*4);
|
||||
|
||||
|
|
@ -404,7 +404,7 @@ Image LoadImageSvg(const char *fileNameOrString, int width, int height)
|
|||
nsvgDeleteRasterizer(rast);
|
||||
}
|
||||
|
||||
if (isSvgStringValid && (fileData != fileNameOrString)) UnloadFileData(fileData);
|
||||
if (isSvgStringValid && (fileData != (unsigned char *)fileNameOrString)) UnloadFileData(fileData);
|
||||
}
|
||||
#else
|
||||
TRACELOG(LOG_WARNING, "SVG image support not enabled, image can not be loaded");
|
||||
|
|
@ -611,7 +611,7 @@ Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, i
|
|||
(fileData[2] == 'v') &&
|
||||
(fileData[3] == 'g'))
|
||||
{
|
||||
struct NSVGimage *svgImage = nsvgParse(fileData, "px", 96.0f);
|
||||
struct NSVGimage *svgImage = nsvgParse((char *)fileData, "px", 96.0f);
|
||||
unsigned char *img = RL_MALLOC(svgImage->width*svgImage->height*4);
|
||||
|
||||
// Rasterize
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user