summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorRay <[email protected]>2021-03-17 12:17:35 +0100
committerRay <[email protected]>2021-03-17 12:17:35 +0100
commit23b966d5155c721b71447ddb5129f9a3424ce5fb (patch)
treecdb63a53df1a177a28b63deffbc5650a6f77adcf /examples
parent0ae8e4d606b8d9bd41f875f9395fcf3bfa1c9121 (diff)
downloadraylib.com-23b966d5155c721b71447ddb5129f9a3424ce5fb.tar.gz
raylib.com-23b966d5155c721b71447ddb5129f9a3424ce5fb.zip
Update examples to use latest enum values
Diffstat (limited to 'examples')
-rw-r--r--examples/web/models/models_first_person_maze.c2
-rw-r--r--examples/web/models/models_skybox.c14
-rw-r--r--examples/web/shaders/rlights.h10
-rw-r--r--examples/web/shaders/shaders_basic_lighting.c4
-rw-r--r--examples/web/shaders/shaders_custom_uniform.c2
-rw-r--r--examples/web/shaders/shaders_palette_switch.c2
-rw-r--r--examples/web/text/text_font_filters.c8
-rw-r--r--examples/web/textures/textures_draw_tiled.c2
-rw-r--r--examples/web/textures/textures_npatch_drawing.c8
9 files changed, 26 insertions, 26 deletions
diff --git a/examples/web/models/models_first_person_maze.c b/examples/web/models/models_first_person_maze.c
index d9e3edb..d0be66f 100644
--- a/examples/web/models/models_first_person_maze.c
+++ b/examples/web/models/models_first_person_maze.c
@@ -85,7 +85,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
- UnoadImageColors(mapPixels); // Unload color array
+ UnloadImageColors(mapPixels); // Unload color array
UnloadTexture(cubicmap); // Unload cubicmap texture
UnloadTexture(texture); // Unload map texture
diff --git a/examples/web/models/models_skybox.c b/examples/web/models/models_skybox.c
index e6727e3..0853cd5 100644
--- a/examples/web/models/models_skybox.c
+++ b/examples/web/models/models_skybox.c
@@ -55,8 +55,8 @@ int main(void)
#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
skybox.materials[0].shader = LoadShader("resources/shaders/glsl100/skybox.vs", "resources/shaders/glsl100/skybox.fs");
#endif
- SetShaderValue(skybox.materials[0].shader, GetShaderLocation(skybox.materials[0].shader, "environmentMap"), (int[1]){ MAP_CUBEMAP }, UNIFORM_INT);
- SetShaderValue(skybox.materials[0].shader, GetShaderLocation(skybox.materials[0].shader, "vflipped"), (int[1]){ 1 }, UNIFORM_INT);
+ SetShaderValue(skybox.materials[0].shader, GetShaderLocation(skybox.materials[0].shader, "environmentMap"), (int[1]){ MATERIAL_MAP_CUBEMAP }, SHADER_UNIFORM_INT);
+ SetShaderValue(skybox.materials[0].shader, GetShaderLocation(skybox.materials[0].shader, "vflipped"), (int[1]){ 1 }, SHADER_UNIFORM_INT);
// Load cubemap shader and setup required shader locations
#if defined(PLATFORM_DESKTOP)
@@ -64,7 +64,7 @@ int main(void)
#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
shdrCubemap = LoadShader("resources/shaders/glsl100/cubemap.vs", "resources/shaders/glsl100/cubemap.fs");
#endif
- SetShaderValue(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, UNIFORM_INT);
+ SetShaderValue(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, SHADER_UNIFORM_INT);
// Load HDR panorama (sphere) texture
TextCopy(panoFileName, "resources/dresden_square_2k.hdr");
@@ -73,8 +73,8 @@ int main(void)
// Generate cubemap (texture with 6 quads-cube-mapping) from panorama HDR texture
// NOTE 1: New texture is generated rendering to texture, shader calculates the sphere->cube coordinates mapping
// NOTE 2: It seems on some Android devices WebGL, fbo does not properly support a FLOAT-based attachment,
- // despite texture can be successfully created.. so using UNCOMPRESSED_R8G8B8A8 instead of UNCOMPRESSED_R32G32B32A32
- skybox.materials[0].maps[MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, UNCOMPRESSED_R8G8B8A8);
+ // despite texture can be successfully created.. so using PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 instead of PIXELFORMAT_UNCOMPRESSED_R32G32B32A32
+ skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8);
UnloadTexture(panorama); // Texture not required anymore, cubemap already generated
@@ -123,12 +123,12 @@ void UpdateDrawFrame(void)
if (IsFileExtension(droppedFiles[0], ".png;.jpg;.hdr;.bmp;.tga"))
{
// Unload current cubemap texture and load new one
- UnloadTexture(skybox.materials[0].maps[MAP_CUBEMAP].texture);
+ UnloadTexture(skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture);
panorama = LoadTexture(droppedFiles[0]);
TextCopy(panoFileName, droppedFiles[0]);
// Generate cubemap from panorama texture
- skybox.materials[0].maps[MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, UNCOMPRESSED_R8G8B8A8);
+ skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, panorama, 1024, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8);
UnloadTexture(panorama);
}
}
diff --git a/examples/web/shaders/rlights.h b/examples/web/shaders/rlights.h
index f9727c9..a607893 100644
--- a/examples/web/shaders/rlights.h
+++ b/examples/web/shaders/rlights.h
@@ -168,21 +168,21 @@ Light CreateLight(int type, Vector3 position, Vector3 target, Color color, Shade
void UpdateLightValues(Shader shader, Light light)
{
// Send to shader light enabled state and type
- SetShaderValue(shader, light.enabledLoc, &light.enabled, UNIFORM_INT);
- SetShaderValue(shader, light.typeLoc, &light.type, UNIFORM_INT);
+ SetShaderValue(shader, light.enabledLoc, &light.enabled, SHADER_UNIFORM_INT);
+ SetShaderValue(shader, light.typeLoc, &light.type, SHADER_UNIFORM_INT);
// Send to shader light position values
float position[3] = { light.position.x, light.position.y, light.position.z };
- SetShaderValue(shader, light.posLoc, position, UNIFORM_VEC3);
+ SetShaderValue(shader, light.posLoc, position, SHADER_UNIFORM_VEC3);
// Send to shader light target position values
float target[3] = { light.target.x, light.target.y, light.target.z };
- SetShaderValue(shader, light.targetLoc, target, UNIFORM_VEC3);
+ SetShaderValue(shader, light.targetLoc, target, SHADER_UNIFORM_VEC3);
// Send to shader light color values
float color[4] = { (float)light.color.r/(float)255, (float)light.color.g/(float)255,
(float)light.color.b/(float)255, (float)light.color.a/(float)255 };
- SetShaderValue(shader, light.colorLoc, color, UNIFORM_VEC4);
+ SetShaderValue(shader, light.colorLoc, color, SHADER_UNIFORM_VEC4);
}
#endif // RLIGHTS_IMPLEMENTATION \ No newline at end of file
diff --git a/examples/web/shaders/shaders_basic_lighting.c b/examples/web/shaders/shaders_basic_lighting.c
index 05b5acc..47c8de9 100644
--- a/examples/web/shaders/shaders_basic_lighting.c
+++ b/examples/web/shaders/shaders_basic_lighting.c
@@ -108,7 +108,7 @@ int main(void)
// ambient light level
ambientLoc = GetShaderLocation(shader, "ambient");
- SetShaderValue(shader, ambientLoc, (float[4]){ 0.2f, 0.2f, 0.2f, 1.0f }, UNIFORM_VEC4);
+ SetShaderValue(shader, ambientLoc, (float[4]){ 0.2f, 0.2f, 0.2f, 1.0f }, SHADER_UNIFORM_VEC4);
// All models use the same shader
modelA.materials[0].shader = shader;
@@ -187,7 +187,7 @@ void UpdateDrawFrame(void)
// Update the light shader with the camera view position
float cameraPos[3] = { camera.position.x, camera.position.y, camera.position.z };
- SetShaderValue(shader, shader.locs[SHADER_LOC_VECTOR_VIEW], cameraPos, UNIFORM_VEC3);
+ SetShaderValue(shader, shader.locs[SHADER_LOC_VECTOR_VIEW], cameraPos, SHADER_UNIFORM_VEC3);
//----------------------------------------------------------------------------------
// Draw
diff --git a/examples/web/shaders/shaders_custom_uniform.c b/examples/web/shaders/shaders_custom_uniform.c
index 83fa51c..e574dc4 100644
--- a/examples/web/shaders/shaders_custom_uniform.c
+++ b/examples/web/shaders/shaders_custom_uniform.c
@@ -129,7 +129,7 @@ void UpdateDrawFrame(void)
swirlCenter[1] = screenHeight - mousePosition.y;
// Send new value to the shader to be used on drawing
- SetShaderValue(shader, swirlCenterLoc, swirlCenter, UNIFORM_VEC2);
+ SetShaderValue(shader, swirlCenterLoc, swirlCenter, SHADER_UNIFORM_VEC2);
UpdateCamera(&camera); // Update camera
//----------------------------------------------------------------------------------
diff --git a/examples/web/shaders/shaders_palette_switch.c b/examples/web/shaders/shaders_palette_switch.c
index 6e2e618..29f3070 100644
--- a/examples/web/shaders/shaders_palette_switch.c
+++ b/examples/web/shaders/shaders_palette_switch.c
@@ -153,7 +153,7 @@ void UpdateDrawFrame(void)
// Send new value to the shader to be used on drawing.
// NOTE: We are sending RGB triplets w/o the alpha channel
- SetShaderValueV(shader, paletteLoc, palettes[currentPalette], UNIFORM_IVEC3, COLORS_PER_PALETTE);
+ SetShaderValueV(shader, paletteLoc, palettes[currentPalette], SHADER_UNIFORM_IVEC3, COLORS_PER_PALETTE);
//----------------------------------------------------------------------------------
// Draw
diff --git a/examples/web/text/text_font_filters.c b/examples/web/text/text_font_filters.c
index f2b44f8..8248bba 100644
--- a/examples/web/text/text_font_filters.c
+++ b/examples/web/text/text_font_filters.c
@@ -59,7 +59,7 @@ int main(void)
fontSize = font.baseSize;
- SetTextureFilter(font.texture, FILTER_POINT);
+ SetTextureFilter(font.texture, TEXTURE_FILTER_POINT);
fontPosition = (Vector2){ 40, screenHeight/2 - 70 };
@@ -100,18 +100,18 @@ void UpdateDrawFrame(void)
// Choose font texture filter method
if (IsKeyPressed(KEY_ONE))
{
- SetTextureFilter(font.texture, FILTER_POINT);
+ SetTextureFilter(font.texture, TEXTURE_FILTER_POINT);
currentFontFilter = 0;
}
else if (IsKeyPressed(KEY_TWO))
{
- SetTextureFilter(font.texture, FILTER_BILINEAR);
+ SetTextureFilter(font.texture, TEXTURE_FILTER_BILINEAR);
currentFontFilter = 1;
}
else if (IsKeyPressed(KEY_THREE))
{
// NOTE: Trilinear filter won't be noticed on 2D drawing
- SetTextureFilter(font.texture, FILTER_TRILINEAR);
+ SetTextureFilter(font.texture, TEXTURE_FILTER_TRILINEAR);
currentFontFilter = 2;
}
diff --git a/examples/web/textures/textures_draw_tiled.c b/examples/web/textures/textures_draw_tiled.c
index 160117f..893d9b8 100644
--- a/examples/web/textures/textures_draw_tiled.c
+++ b/examples/web/textures/textures_draw_tiled.c
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
Texture texPattern = LoadTexture("resources/patterns.png");
- SetTextureFilter(texPattern, FILTER_TRILINEAR); // Makes the texture smoother when upscaled
+ SetTextureFilter(texPattern, TEXTURE_FILTER_TRILINEAR); // Makes the texture smoother when upscaled
// Coordinates for all patterns inside the texture
const Rectangle recPattern[] = {
diff --git a/examples/web/textures/textures_npatch_drawing.c b/examples/web/textures/textures_npatch_drawing.c
index bf49177..a90bcff 100644
--- a/examples/web/textures/textures_npatch_drawing.c
+++ b/examples/web/textures/textures_npatch_drawing.c
@@ -39,14 +39,14 @@ Rectangle dstRecH = { 160.0f, 93.0f, 32.0f, 32.0f };
Rectangle dstRecV = { 92.0f, 160.0f, 32.0f, 32.0f };
// A 9-patch (NPT_9PATCH) changes its sizes in both axis
-NPatchInfo ninePatchInfo1 = { (Rectangle){ 0.0f, 0.0f, 64.0f, 64.0f }, 12, 40, 12, 12, NPT_9PATCH };
-NPatchInfo ninePatchInfo2 = { (Rectangle){ 0.0f, 128.0f, 64.0f, 64.0f }, 16, 16, 16, 16, NPT_9PATCH };
+NPatchInfo ninePatchInfo1 = { (Rectangle){ 0.0f, 0.0f, 64.0f, 64.0f }, 12, 40, 12, 12, NPATCH_NINE_PATCH };
+NPatchInfo ninePatchInfo2 = { (Rectangle){ 0.0f, 128.0f, 64.0f, 64.0f }, 16, 16, 16, 16, NPATCH_NINE_PATCH };
// A horizontal 3-patch (NPT_3PATCH_HORIZONTAL) changes its sizes along the x axis only
-NPatchInfo h3PatchInfo = { (Rectangle){ 0.0f, 64.0f, 64.0f, 64.0f }, 8, 8, 8, 8, NPT_3PATCH_HORIZONTAL };
+NPatchInfo h3PatchInfo = { (Rectangle){ 0.0f, 64.0f, 64.0f, 64.0f }, 8, 8, 8, 8, NPATCH_THREE_PATCH_HORIZONTAL };
// A vertical 3-patch (NPT_3PATCH_VERTICAL) changes its sizes along the y axis only
-NPatchInfo v3PatchInfo = { (Rectangle){ 0.0f, 192.0f, 64.0f, 64.0f }, 6, 6, 6, 6, NPT_3PATCH_VERTICAL };
+NPatchInfo v3PatchInfo = { (Rectangle){ 0.0f, 192.0f, 64.0f, 64.0f }, 6, 6, 6, 6, NPATCH_THREE_PATCH_VERTICAL };
//----------------------------------------------------------------------------------
// Module Functions Declaration