summaryrefslogtreecommitdiffhomepage
path: root/examples/others
diff options
context:
space:
mode:
authorRay <[email protected]>2019-01-10 16:57:15 +0100
committerGitHub <[email protected]>2019-01-10 16:57:15 +0100
commit56173d7cf457413fd56e26967becc7c5054aa2cf (patch)
treef1428e583f4ed5ee8c7060c47da55e8ce0194882 /examples/others
parent6056a2a5cf2aa939a10e807e452ed43d4b67f1ce (diff)
parent93471b0a7c75fc675f27fc74dfda281eb8310a7a (diff)
downloadraylib-56173d7cf457413fd56e26967becc7c5054aa2cf.tar.gz
raylib-56173d7cf457413fd56e26967becc7c5054aa2cf.zip
Merge branch 'master' into window-visibility
Diffstat (limited to 'examples/others')
-rw-r--r--examples/others/raudio_standalone.c (renamed from examples/others/audio_standalone.c)10
-rw-r--r--examples/others/standard_lighting.c25
2 files changed, 16 insertions, 19 deletions
diff --git a/examples/others/audio_standalone.c b/examples/others/raudio_standalone.c
index d6e75066..930bde85 100644
--- a/examples/others/audio_standalone.c
+++ b/examples/others/raudio_standalone.c
@@ -1,19 +1,19 @@
/*******************************************************************************************
*
-* raylib [audio] example - Using audio module as standalone module
+* raylib [audio] example - Using raudio module as standalone module
*
* NOTE: This example does not require any graphic device, it can run directly on console.
*
* DEPENDENCIES:
* mini_al.h - Audio device management lib (http://kcat.strangesoft.net/openal.html)
-* stb_vorbis.c - Ogg audio files loading (http://www.nothings.org/stb_vorbis/)
+* stb_vorbis.h - Ogg audio files loading (http://www.nothings.org/stb_vorbis/)
* jar_xm.h - XM module file loading
* jar_mod.h - MOD audio file loading
* dr_flac.h - FLAC audio file loading
*
* COMPILATION:
* gcc -c ..\..\src\external\mini_al.c -Wall -I.
-* gcc -o audio_standalone.exe audio_standalone.c ..\..\src\audio.c ..\..\src\external\stb_vorbis.c mini_al.o /
+* gcc -o audio_standalone.exe audio_standalone.c ..\..\src\raudio.c mini_al.o /
* -I..\..\src -I..\..\src\external -L. -Wall -std=c99 /
* -DAUDIO_STANDALONE -DSUPPORT_FILEFORMAT_WAV -DSUPPORT_FILEFORMAT_OGG
*
@@ -22,7 +22,7 @@
* This example 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) 2014-2018 Ramon Santamaria (@raysan5)
+* Copyright (c) 2014-2019 Ramon Santamaria (@raysan5)
*
* This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software.
@@ -41,7 +41,7 @@
*
********************************************************************************************/
-#include "audio.h" // Audio library
+#include "raudio.h" // raylib audio library
#include <stdio.h> // Required for: printf()
diff --git a/examples/others/standard_lighting.c b/examples/others/standard_lighting.c
index 72890436..7034aa35 100644
--- a/examples/others/standard_lighting.c
+++ b/examples/others/standard_lighting.c
@@ -350,9 +350,6 @@ static void GetShaderLightsLocations(Shader shader)
// Set shader uniform values for lights
// NOTE: It would be far easier with shader UBOs but are not supported on OpenGL ES 2.0
-// TODO: Replace glUniform1i(), glUniform1f(), glUniform3f(), glUniform4f():
-//SetShaderValue(Shader shader, int uniformLoc, float *value, int size)
-//SetShaderValuei(Shader shader, int uniformLoc, int *value, int size)
static void SetShaderLightsValues(Shader shader)
{
int tempInt[8] = { 0 };
@@ -363,20 +360,20 @@ static void SetShaderLightsValues(Shader shader)
if (i < lightsCount)
{
tempInt[0] = lights[i]->enabled;
- SetShaderValuei(shader, lightsLocs[i][0], tempInt, 1); //glUniform1i(lightsLocs[i][0], lights[i]->enabled);
+ SetShaderValue(shader, lightsLocs[i][0], tempInt, UNIFORM_INT); //glUniform1i(lightsLocs[i][0], lights[i]->enabled);
tempInt[0] = lights[i]->type;
- SetShaderValuei(shader, lightsLocs[i][1], tempInt, 1); //glUniform1i(lightsLocs[i][1], lights[i]->type);
+ SetShaderValue(shader, lightsLocs[i][1], tempInt, UNIFORM_INT); //glUniform1i(lightsLocs[i][1], lights[i]->type);
tempFloat[0] = (float)lights[i]->diffuse.r/255.0f;
tempFloat[1] = (float)lights[i]->diffuse.g/255.0f;
tempFloat[2] = (float)lights[i]->diffuse.b/255.0f;
tempFloat[3] = (float)lights[i]->diffuse.a/255.0f;
- SetShaderValue(shader, lightsLocs[i][5], tempFloat, 4);
+ SetShaderValue(shader, lightsLocs[i][5], tempFloat, UNIFORM_VEC4);
//glUniform4f(lightsLocs[i][5], (float)lights[i]->diffuse.r/255, (float)lights[i]->diffuse.g/255, (float)lights[i]->diffuse.b/255, (float)lights[i]->diffuse.a/255);
tempFloat[0] = lights[i]->intensity;
- SetShaderValue(shader, lightsLocs[i][6], tempFloat, 1);
+ SetShaderValue(shader, lightsLocs[i][6], tempFloat, UNIFORM_FLOAT);
switch (lights[i]->type)
{
@@ -385,10 +382,10 @@ static void SetShaderLightsValues(Shader shader)
tempFloat[0] = lights[i]->position.x;
tempFloat[1] = lights[i]->position.y;
tempFloat[2] = lights[i]->position.z;
- SetShaderValue(shader, lightsLocs[i][2], tempFloat, 3);
+ SetShaderValue(shader, lightsLocs[i][2], tempFloat, UNIFORM_VEC3);
tempFloat[0] = lights[i]->radius;
- SetShaderValue(shader, lightsLocs[i][4], tempFloat, 1);
+ SetShaderValue(shader, lightsLocs[i][4], tempFloat, UNIFORM_FLOAT);
//glUniform3f(lightsLocs[i][2], lights[i]->position.x, lights[i]->position.y, lights[i]->position.z);
//glUniform1f(lightsLocs[i][4], lights[i]->radius);
@@ -401,7 +398,7 @@ static void SetShaderLightsValues(Shader shader)
tempFloat[0] = direction.x;
tempFloat[1] = direction.y;
tempFloat[2] = direction.z;
- SetShaderValue(shader, lightsLocs[i][3], tempFloat, 3);
+ SetShaderValue(shader, lightsLocs[i][3], tempFloat, UNIFORM_VEC3);
//glUniform3f(lightsLocs[i][3], direction.x, direction.y, direction.z);
} break;
@@ -410,7 +407,7 @@ static void SetShaderLightsValues(Shader shader)
tempFloat[0] = lights[i]->position.x;
tempFloat[1] = lights[i]->position.y;
tempFloat[2] = lights[i]->position.z;
- SetShaderValue(shader, lightsLocs[i][2], tempFloat, 3);
+ SetShaderValue(shader, lightsLocs[i][2], tempFloat, UNIFORM_VEC3);
//glUniform3f(lightsLocs[i][2], lights[i]->position.x, lights[i]->position.y, lights[i]->position.z);
@@ -420,11 +417,11 @@ static void SetShaderLightsValues(Shader shader)
tempFloat[0] = direction.x;
tempFloat[1] = direction.y;
tempFloat[2] = direction.z;
- SetShaderValue(shader, lightsLocs[i][3], tempFloat, 3);
+ SetShaderValue(shader, lightsLocs[i][3], tempFloat, UNIFORM_VEC3);
//glUniform3f(lightsLocs[i][3], direction.x, direction.y, direction.z);
tempFloat[0] = lights[i]->coneAngle;
- SetShaderValue(shader, lightsLocs[i][7], tempFloat, 1);
+ SetShaderValue(shader, lightsLocs[i][7], tempFloat, UNIFORM_FLOAT);
//glUniform1f(lightsLocs[i][7], lights[i]->coneAngle);
} break;
default: break;
@@ -433,7 +430,7 @@ static void SetShaderLightsValues(Shader shader)
else
{
tempInt[0] = 0;
- SetShaderValuei(shader, lightsLocs[i][0], tempInt, 1); //glUniform1i(lightsLocs[i][0], 0); // Light disabled
+ SetShaderValue(shader, lightsLocs[i][0], tempInt, UNIFORM_INT); //glUniform1i(lightsLocs[i][0], 0); // Light disabled
}
}
}