aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRay San <raysan5@gmail.com>2017-10-17 13:30:41 +0200
committerRay San <raysan5@gmail.com>2017-10-17 13:30:41 +0200
commit8ace02c2ffd9dead6e67fb3faaaa8b8ad37ccd2a (patch)
tree783724d3a736b5fac7d2c930cd58a2f41aca872c /examples
parent76c821a68d35811a8d5adc384191ee5daa69afdd (diff)
downloadraylib-8ace02c2ffd9dead6e67fb3faaaa8b8ad37ccd2a.tar.gz
raylib-8ace02c2ffd9dead6e67fb3faaaa8b8ad37ccd2a.zip
Added new examples to build...
...and reviewed some details
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile15
-rw-r--r--examples/models/models_material_pbr.c12
2 files changed, 18 insertions, 9 deletions
diff --git a/examples/Makefile b/examples/Makefile
index b80b18fe..bd4552cb 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -82,20 +82,20 @@ endif
# Define raylib release directory for compiled library
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
- RAYLIB_RELEASE = $(RAYLIB_PATH)/release/win32/mingw32
+ RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/win32/mingw32
endif
ifeq ($(PLATFORM_OS),LINUX)
- RAYLIB_RELEASE = $(RAYLIB_PATH)/release/linux
+ RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/linux
endif
ifeq ($(PLATFORM_OS),OSX)
- RAYLIB_RELEASE = $(RAYLIB_PATH)/release/osx
+ RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/osx
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
- RAYLIB_RELEASE = $(RAYLIB_PATH)/release/html5
+ RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/html5
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
- RAYLIB_RELEASE = $(RAYLIB_PATH)/release/rpi
+ RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/rpi
endif
# Define default C compiler: gcc
@@ -263,6 +263,7 @@ EXAMPLES = \
textures/textures_particles_blending \
textures/textures_image_processing \
textures/textures_image_drawing \
+ textures/textures_image_generation \
text/text_sprite_fonts \
text/text_bmfont_ttf \
text/text_raylib_fonts \
@@ -278,6 +279,10 @@ EXAMPLES = \
models/models_heightmap \
models/models_cubicmap \
models/models_mesh_picking \
+ models/models_mesh_generation \
+ models/models_yaw_pitch_roll \
+ models/models_material_pbr \
+ models/models_skybox \
shaders/shaders_model_shader \
shaders/shaders_shapes_textures \
shaders/shaders_custom_uniform \
diff --git a/examples/models/models_material_pbr.c b/examples/models/models_material_pbr.c
index 1f069468..9f576348 100644
--- a/examples/models/models_material_pbr.c
+++ b/examples/models/models_material_pbr.c
@@ -41,10 +41,13 @@ int main()
model.material = LoadMaterialPBR((Color){ 255, 255, 255, 255 }, 1.0f, 1.0f);
// Define lights attributes
- Light lights[MAX_LIGHTS] = { CreateLight(LIGHT_POINT, (Vector3){ LIGHT_DISTANCE, LIGHT_HEIGHT, 0.0f }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 255, 0, 0, 255 }, model.material.shader),
- CreateLight(LIGHT_POINT, (Vector3){ 0.0f, LIGHT_HEIGHT, LIGHT_DISTANCE }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 0, 255, 0, 255 }, model.material.shader),
- CreateLight(LIGHT_POINT, (Vector3){ -LIGHT_DISTANCE, LIGHT_HEIGHT, 0.0f }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 0, 0, 255, 255 }, model.material.shader),
- CreateLight(LIGHT_DIRECTIONAL, (Vector3){ 0.0f, LIGHT_HEIGHT*2.0f, -LIGHT_DISTANCE }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 255, 0, 255, 255 }, model.material.shader) };
+ // NOTE: Shader is passed to every light on creation to define shader bindings internally
+ Light lights[MAX_LIGHTS] = {
+ CreateLight(LIGHT_POINT, (Vector3){ LIGHT_DISTANCE, LIGHT_HEIGHT, 0.0f }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 255, 0, 0, 255 }, model.material.shader),
+ CreateLight(LIGHT_POINT, (Vector3){ 0.0f, LIGHT_HEIGHT, LIGHT_DISTANCE }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 0, 255, 0, 255 }, model.material.shader),
+ CreateLight(LIGHT_POINT, (Vector3){ -LIGHT_DISTANCE, LIGHT_HEIGHT, 0.0f }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 0, 0, 255, 255 }, model.material.shader),
+ CreateLight(LIGHT_DIRECTIONAL, (Vector3){ 0.0f, LIGHT_HEIGHT*2.0f, -LIGHT_DISTANCE }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 255, 0, 255, 255 }, model.material.shader)
+ };
SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode
@@ -156,6 +159,7 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness)
UnloadTexture(cubemap);
UnloadTexture(texHDR);
+ // Unload already used shaders (to create specific textures)
UnloadShader(shdrCubemap);
UnloadShader(shdrIrradiance);
UnloadShader(shdrPrefilter);