summaryrefslogtreecommitdiffhomepage
path: root/examples/shaders
diff options
context:
space:
mode:
authorRay <[email protected]>2023-10-31 20:59:08 +0100
committerRay <[email protected]>2023-10-31 20:59:08 +0100
commitdf0f7ba61e6a89e493d8b6313001ecf6a7231e5a (patch)
tree330d3bf50fc822f8ce0eeb6824f0d401063b93b4 /examples/shaders
parentaca854ccbf1fe9fac04f2067ffc90960e621e927 (diff)
downloadraylib-df0f7ba61e6a89e493d8b6313001ecf6a7231e5a.tar.gz
raylib-df0f7ba61e6a89e493d8b6313001ecf6a7231e5a.zip
Update shaders_deferred_render.c
Diffstat (limited to 'examples/shaders')
-rw-r--r--examples/shaders/shaders_deferred_render.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/shaders/shaders_deferred_render.c b/examples/shaders/shaders_deferred_render.c
index 5bb4db1d..21d2af34 100644
--- a/examples/shaders/shaders_deferred_render.c
+++ b/examples/shaders/shaders_deferred_render.c
@@ -31,6 +31,8 @@
#include <stdlib.h> // Required for: NULL
+#define MAX_CUBES 30
+
typedef struct GBuffer {
unsigned int framebuffer;
@@ -144,18 +146,18 @@ int main(void)
lights[2] = CreateLight(LIGHT_POINT, (Vector3){ -2, 1, 2 }, Vector3Zero(), GREEN, deferredShader);
lights[3] = CreateLight(LIGHT_POINT, (Vector3){ 2, 1, -2 }, Vector3Zero(), BLUE, deferredShader);
- const int MAX_CUBES = 30;
const float CUBE_SCALE = 0.25;
- Vector3 cubePositions[MAX_CUBES];
- float cubeRotations[MAX_CUBES];
+ Vector3 cubePositions[MAX_CUBES] = { 0 };
+ float cubeRotations[MAX_CUBES] = { 0 };
- for(int i = 0; i < MAX_CUBES; i++)
+ for (int i = 0; i < MAX_CUBES; i++)
{
cubePositions[i] = (Vector3){
.x = (float)(rand()%10) - 5,
.y = (float)(rand()%5),
.z = (float)(rand()%10) - 5,
};
+
cubeRotations[i] = (float)(rand()%360);
}