REXM: Updated some examples inconsistencies

This commit is contained in:
Ray
2025-09-04 19:15:37 +02:00
parent 91bc8d9b10
commit a51cb7fe30
16 changed files with 71 additions and 41 deletions

View File

@ -1,6 +1,6 @@
/*******************************************************************************************
*
* raylib [easings] example - easings testbed
* raylib [others] example - easings testbed
*
* Example originally created with raylib 2.5, last time updated with raylib 2.5
*
@ -108,7 +108,7 @@ int main(void)
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [easings] example - easings testbed");
InitWindow(screenWidth, screenHeight, "raylib [others] example - easings testbed");
Vector2 ballPosition = { 100.0f, 100.0f };

View File

@ -4,7 +4,7 @@
*
* Example complexity rating: [★★★★] 4/4
*
* Example originally created with raylib 3.8, last time updated with raylib 2.5
* Example originally created with raylib 3.8, last time updated with raylib 4.0
*
* Example contributed by Stephan Soller (@arkanis) and reviewed by Ramon Santamaria (@raysan5)
*

View File

@ -0,0 +1,14 @@
#version 120
// Input uniform values
uniform vec4 color;
// NOTE: Add your custom variables here
void main()
{
// Each point is drawn as a screen space square of gl_PointSize size. gl_PointCoord contains where we are inside of
// it. (0, 0) is the top left, (1, 1) the bottom right corner
// Draw each point as a colored circle with alpha 1.0 in the center and 0.0 at the outer edges
gl_FragColor = vec4(color.rgb, color.a*(1.0 - length(gl_PointCoord.xy - vec2(0.5))*2.0));
}

View File

@ -0,0 +1,24 @@
#version 120
// Input vertex attributes
attribute vec3 vertexPosition;
// Input uniform values
uniform mat4 mvp;
uniform float currentTime;
// NOTE: Add your custom variables here
void main()
{
// Unpack data from vertexPosition
vec2 pos = vertexPosition.xy;
float period = vertexPosition.z;
// Calculate final vertex position (jiggle it around a bit horizontally)
pos += vec2(100.0, 0.0)*sin(period*currentTime);
gl_Position = mvp*vec4(pos.x, pos.y, 0.0, 1.0);
// Calculate the screen space size of this particle (also vary it over time)
gl_PointSize = 10.0 - 5.0*abs(sin(period*currentTime));
}

View File

@ -1,13 +1,13 @@
/*******************************************************************************************
*
* raylib [rlgl] example - compute shader - game of life
* raylib [others] example - compute shader - game of life
*
* NOTE: This example requires raylib OpenGL 4.3 versions for compute shaders support,
* shaders used in this example are #version 430 (OpenGL 4.3)
*
* Example complexity rating: [★★★★] 4/4
*
* Example originally created with raylib 4.0, last time updated with raylib 2.5
* Example originally created with raylib 4.0, last time updated with raylib 4.0
*
* Example contributed by Teddy Astie (@tsnake41) and reviewed by Ramon Santamaria (@raysan5)
*
@ -57,7 +57,7 @@ int main(void)
const int screenWidth = GOL_WIDTH;
const int screenHeight = GOL_WIDTH;
InitWindow(screenWidth, screenHeight, "raylib [rlgl] example - compute shader - game of life");
InitWindow(screenWidth, screenHeight, "raylib [others] example - compute shader - game of life");
const Vector2 resolution = { screenWidth, screenHeight };
unsigned int brushSize = 8;

View File

@ -1,6 +1,6 @@
/*******************************************************************************************
*
* raylib [rlgl] example - Using rlgl module as standalone module
* raylib [others] example - Using rlgl module as standalone module
*
* rlgl library is an abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, ES 2.0)
* that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...)
@ -147,7 +147,7 @@ int main(void)
glfwWindowHint( GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE );
#endif
GLFWwindow *window = glfwCreateWindow(screenWidth, screenHeight, "rlgl standalone", NULL, NULL);
GLFWwindow *window = glfwCreateWindow(screenWidth, screenHeight, "raylib [others] example - rlgl standalone", NULL, NULL);
if (!window)
{