aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2015-09-01 22:59:16 +0200
committerraysan5 <raysan5@gmail.com>2015-09-01 22:59:16 +0200
commite5fe2c216ec92d6ec2205fac10023b5a304f6f26 (patch)
treec4d3927e89ae40ebbeabbfffdaed80e9d7ab0968 /examples
parente93475d854279a99dc2cf296f8c9827bc2c36c09 (diff)
downloadraylib-e5fe2c216ec92d6ec2205fac10023b5a304f6f26.tar.gz
raylib-e5fe2c216ec92d6ec2205fac10023b5a304f6f26.zip
Added some comments to examples
Diffstat (limited to 'examples')
-rw-r--r--examples/audio_music_stream.c8
-rw-r--r--examples/core_3d_picking.c2
-rw-r--r--examples/core_drop_files.c4
-rw-r--r--examples/makefile2
-rw-r--r--examples/models_cubicmap.c2
-rw-r--r--examples/textures_image_loading.c4
-rw-r--r--examples/textures_particles_trail_blending.c1
-rw-r--r--examples/textures_raw_data.c3
-rw-r--r--examples/textures_rectangle.c2
-rw-r--r--examples/textures_srcrec_dstrec.c4
-rw-r--r--examples/textures_to_image.c4
11 files changed, 21 insertions, 15 deletions
diff --git a/examples/audio_music_stream.c b/examples/audio_music_stream.c
index 3add91da..e61d4839 100644
--- a/examples/audio_music_stream.c
+++ b/examples/audio_music_stream.c
@@ -4,10 +4,10 @@
*
* NOTE: This example requires OpenAL Soft library installed
*
-* This example has been created using raylib 1.1 (www.raylib.com)
+* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2014 Ramon Santamaria (@raysan5)
+* Copyright (c) 2015 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -61,9 +61,9 @@ int main()
if (IsWindowMinimized()) PauseMusicStream();
else ResumeMusicStream();
- timePlayed = GetMusicTimePlayed() / GetMusicTimeLength() * 100 * 4; // We scale by 4 to fit 400 pixels
+ timePlayed = GetMusicTimePlayed()/GetMusicTimeLength()*100*4; // We scale by 4 to fit 400 pixels
- UpdateMusicStream();
+ UpdateMusicStream(); // Update music buffer with new stream data
//----------------------------------------------------------------------------------
// Draw
diff --git a/examples/core_3d_picking.c b/examples/core_3d_picking.c
index 13839070..2fc05e81 100644
--- a/examples/core_3d_picking.c
+++ b/examples/core_3d_picking.c
@@ -5,7 +5,7 @@
* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2015 Ramon Santamaria (Ray San - raysan@raysanweb.com)
+* Copyright (c) 2015 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
diff --git a/examples/core_drop_files.c b/examples/core_drop_files.c
index 5802e48f..5eea35f3 100644
--- a/examples/core_drop_files.c
+++ b/examples/core_drop_files.c
@@ -2,10 +2,12 @@
*
* raylib [core] example - Windows drop files
*
+* This example only works on platforms that support drag & drop (Windows, Linux, OSX, Html5?)
+*
* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com)
+* Copyright (c) 2015 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
diff --git a/examples/makefile b/examples/makefile
index f351fbad..1f3ddb7f 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -2,7 +2,7 @@
#
# raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten)
#
-# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com)
+# Copyright (c) 2015 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.
diff --git a/examples/models_cubicmap.c b/examples/models_cubicmap.c
index d7fe896c..98fc54af 100644
--- a/examples/models_cubicmap.c
+++ b/examples/models_cubicmap.c
@@ -5,7 +5,7 @@
* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2015 Ramon Santamaria (Ray San - raysan@raysanweb.com)
+* Copyright (c) 2015 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
diff --git a/examples/textures_image_loading.c b/examples/textures_image_loading.c
index 47eb58af..54c73586 100644
--- a/examples/textures_image_loading.c
+++ b/examples/textures_image_loading.c
@@ -4,10 +4,10 @@
*
* NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM)
*
-* This example has been created using raylib 1.1 (www.raylib.com)
+* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2014 Ramon Santamaria (@raysan5)
+* Copyright (c) 2015 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
diff --git a/examples/textures_particles_trail_blending.c b/examples/textures_particles_trail_blending.c
index 1e7abf7e..da01f863 100644
--- a/examples/textures_particles_trail_blending.c
+++ b/examples/textures_particles_trail_blending.c
@@ -13,6 +13,7 @@
#define MAX_PARTICLES 200
+// Particle structure with basic data
typedef struct {
Vector2 position;
Color color;
diff --git a/examples/textures_raw_data.c b/examples/textures_raw_data.c
index a4ff71b3..d1922180 100644
--- a/examples/textures_raw_data.c
+++ b/examples/textures_raw_data.c
@@ -35,6 +35,7 @@ int main()
int width = 1024;
int height = 1024;
+ // Dynamic memory allocation to store pixels data (Color type)
Color *pixels = (Color *)malloc(width*height*sizeof(Color));
for (int y = 0; y < height; y++)
@@ -50,6 +51,8 @@ int main()
Image checkedIm = LoadImageEx(pixels, width, height);
Texture2D checked = LoadTextureFromImage(checkedIm);
UnloadImage(checkedIm); // Unload CPU (RAM) image data
+
+ // Dynamic memory must be freed after using it
free(pixels); // Unload CPU (RAM) pixels data
//---------------------------------------------------------------------------------------
diff --git a/examples/textures_rectangle.c b/examples/textures_rectangle.c
index 61cce9fb..bf52bb18 100644
--- a/examples/textures_rectangle.c
+++ b/examples/textures_rectangle.c
@@ -2,7 +2,7 @@
*
* raylib [textures] example - Texture loading and drawing a part defined by a rectangle
*
-* This example has been created using raylib 1.0 (www.raylib.com)
+* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
diff --git a/examples/textures_srcrec_dstrec.c b/examples/textures_srcrec_dstrec.c
index 72a209fb..58917421 100644
--- a/examples/textures_srcrec_dstrec.c
+++ b/examples/textures_srcrec_dstrec.c
@@ -2,10 +2,10 @@
*
* raylib [textures] example - Texture source and destination rectangles
*
-* This example has been created using raylib 1.1 (www.raylib.com)
+* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2014 Ramon Santamaria (@raysan5)
+* Copyright (c) 2015 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
diff --git a/examples/textures_to_image.c b/examples/textures_to_image.c
index 3ea8e017..37c3b5a0 100644
--- a/examples/textures_to_image.c
+++ b/examples/textures_to_image.c
@@ -4,10 +4,10 @@
*
* NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM)
*
-* This example has been created using raylib 1.1 (www.raylib.com)
+* This example has been created using raylib 1.3 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com)
+* Copyright (c) 2015 Ramon Santamaria (@raysan5)
*
********************************************************************************************/