summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorRay <[email protected]>2017-05-16 15:23:01 +0200
committerRay <[email protected]>2017-05-16 15:23:01 +0200
commita5bfd7db228b90b5ddc183a03e1f0630d7321091 (patch)
treebf3bdc6d20e55e7a54c72e426245156b75f30c15 /examples
parente563ebe240c16c142157c3d21df50c72fe27ff14 (diff)
downloadraylib-a5bfd7db228b90b5ddc183a03e1f0630d7321091.tar.gz
raylib-a5bfd7db228b90b5ddc183a03e1f0630d7321091.zip
Some reviews for RPI
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile15
-rw-r--r--examples/models/models_mesh_picking.c26
-rw-r--r--examples/shaders/shaders_postprocessing.pngbin237145 -> 193424 bytes
-rw-r--r--examples/text/text_ttf_loading.c10
4 files changed, 29 insertions, 22 deletions
diff --git a/examples/Makefile b/examples/Makefile
index c3728b3b..969edd0c 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -162,9 +162,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
# external libraries to link with
# GLFW3
- LFLAGS += -L$(RAYLIB_PATH)/src/external/glfw3/lib/$(LIBPATH)
+ LFLAGS += -L$(RAYLIB_PATH)/src/external/glfw3/lib/$(LIBPATH)
# OpenAL Soft
- LFLAGS += -L$(RAYLIB_PATH)/src/external/openal_soft/lib/$(LIBPATH)
+ LFLAGS += -L$(RAYLIB_PATH)/src/external/openal_soft/lib/$(LIBPATH)
endif
endif
@@ -195,6 +195,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
else
LIBS += -lopenal32dll
endif
+ PHYSAC_LIBS = -static -lpthread
endif
endif
endif
@@ -524,23 +525,23 @@ audio/audio_raw_stream: audio/audio_raw_stream.c
# compile [physac] example - physics demo
physac/physics_demo: physac/physics_demo.c
- $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -static -lpthread -D$(PLATFORM) $(WINFLAGS)
+ $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) $(PHYSAC_LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [physac] example - physics friction
physac/physics_friction: physac/physics_friction.c
- $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -static -lpthread -D$(PLATFORM) $(WINFLAGS)
+ $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) $(PHYSAC_LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [physac] example - physics movement
physac/physics_movement: physac/physics_movement.c
- $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -static -lpthread -D$(PLATFORM) $(WINFLAGS)
+ $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) $(PHYSAC_LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [physac] example - physics restitution
physac/physics_restitution: physac/physics_restitution.c
- $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -static -lpthread -D$(PLATFORM) $(WINFLAGS)
+ $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) $(PHYSAC_LIBS) -D$(PLATFORM) $(WINFLAGS)
# compile [physac] example - physics shatter
physac/physics_shatter: physac/physics_shatter.c
- $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -static -lpthread -D$(PLATFORM) $(WINFLAGS)
+ $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) $(PHYSAC_LIBS) -D$(PLATFORM) $(WINFLAGS)
ifeq ($(PLATFORM),PLATFORM_ANDROID)
external/native_app_glue.o : native_app_glue.c native_app_glue.h
diff --git a/examples/models/models_mesh_picking.c b/examples/models/models_mesh_picking.c
index 0b5247ec..ec151599 100644
--- a/examples/models/models_mesh_picking.c
+++ b/examples/models/models_mesh_picking.c
@@ -89,7 +89,7 @@ int main()
cursorColor = PURPLE;
hitObjectName = "Triangle";
- bary = VectorBarycenter(nearestHit.hitPosition, ta, tb, tc);
+ bary = VectorBarycenter(nearestHit.position, ta, tb, tc);
hitTriangle = true;
}
else hitTriangle = false;
@@ -136,15 +136,15 @@ int main()
// If we hit something, draw the cursor at the hit point
if (nearestHit.hit)
{
- DrawCube(nearestHit.hitPosition, 0.3, 0.3, 0.3, cursorColor);
- DrawCubeWires(nearestHit.hitPosition, 0.3, 0.3, 0.3, RED);
+ DrawCube(nearestHit.position, 0.3, 0.3, 0.3, cursorColor);
+ DrawCubeWires(nearestHit.position, 0.3, 0.3, 0.3, RED);
Vector3 normalEnd;
- normalEnd.x = nearestHit.hitPosition.x + nearestHit.hitNormal.x;
- normalEnd.y = nearestHit.hitPosition.y + nearestHit.hitNormal.y;
- normalEnd.z = nearestHit.hitPosition.z + nearestHit.hitNormal.z;
+ normalEnd.x = nearestHit.position.x + nearestHit.normal.x;
+ normalEnd.y = nearestHit.position.y + nearestHit.normal.y;
+ normalEnd.z = nearestHit.position.z + nearestHit.normal.z;
- DrawLine3D(nearestHit.hitPosition, normalEnd, RED);
+ DrawLine3D(nearestHit.position, normalEnd, RED);
}
DrawRay(ray, MAROON);
@@ -163,14 +163,14 @@ int main()
DrawText(FormatText("Distance: %3.2f", nearestHit.distance), 10, ypos, 10, BLACK);
DrawText(FormatText("Hit Pos: %3.2f %3.2f %3.2f",
- nearestHit.hitPosition.x,
- nearestHit.hitPosition.y,
- nearestHit.hitPosition.z), 10, ypos + 15, 10, BLACK);
+ nearestHit.position.x,
+ nearestHit.position.y,
+ nearestHit.position.z), 10, ypos + 15, 10, BLACK);
DrawText(FormatText("Hit Norm: %3.2f %3.2f %3.2f",
- nearestHit.hitNormal.x,
- nearestHit.hitNormal.y,
- nearestHit.hitNormal.z), 10, ypos + 30, 10, BLACK);
+ nearestHit.normal.x,
+ nearestHit.normal.y,
+ nearestHit.normal.z), 10, ypos + 30, 10, BLACK);
if (hitTriangle) DrawText(FormatText("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, BLACK);
}
diff --git a/examples/shaders/shaders_postprocessing.png b/examples/shaders/shaders_postprocessing.png
index 684cbd41..628ab810 100644
--- a/examples/shaders/shaders_postprocessing.png
+++ b/examples/shaders/shaders_postprocessing.png
Binary files differ
diff --git a/examples/text/text_ttf_loading.c b/examples/text/text_ttf_loading.c
index 02b7f95f..c9c2fb27 100644
--- a/examples/text/text_ttf_loading.c
+++ b/examples/text/text_ttf_loading.c
@@ -38,8 +38,11 @@ int main()
SetTextureFilter(font.texture, FILTER_POINT);
int currentFontFilter = 0; // FILTER_POINT
+ // NOTE: Drag and drop support only available for desktop platforms: Windows, Linux, OSX
+#if defined(PLATFORM_DESKTOP)
int count = 0;
char **droppedFiles;
+#endif
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
@@ -74,6 +77,7 @@ int main()
if (IsKeyDown(KEY_LEFT)) fontPosition.x -= 10;
else if (IsKeyDown(KEY_RIGHT)) fontPosition.x += 10;
+#if defined(PLATFORM_DESKTOP)
// Load a dropped TTF file dynamically (at current fontSize)
if (IsFileDropped())
{
@@ -86,6 +90,7 @@ int main()
ClearDroppedFiles();
}
}
+#endif
//----------------------------------------------------------------------------------
// Draw
@@ -119,10 +124,11 @@ int main()
// De-Initialization
//--------------------------------------------------------------------------------------
+#if defined(PLATFORM_DESKTOP)
+ ClearDroppedFiles(); // Clear internal buffers
+#endif
UnloadSpriteFont(font); // SpriteFont unloading
- ClearDroppedFiles(); // Clear internal buffers
-
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------