Added some comments to examples

This commit is contained in:
raysan5 2015-09-01 22:59:16 +02:00
parent e93475d854
commit e5fe2c216e
11 changed files with 21 additions and 15 deletions

View file

@ -4,10 +4,10 @@
* *
* NOTE: This example requires OpenAL Soft library installed * 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) * 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)
* *
********************************************************************************************/ ********************************************************************************************/
@ -63,7 +63,7 @@ int main()
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 // Draw

View file

@ -5,7 +5,7 @@
* This example has been created using raylib 1.3 (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) * 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)
* *
********************************************************************************************/ ********************************************************************************************/

View file

@ -2,10 +2,12 @@
* *
* raylib [core] example - Windows drop files * 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) * 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) * 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)
* *
********************************************************************************************/ ********************************************************************************************/

View file

@ -2,7 +2,7 @@
# #
# raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten) # 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 # 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. # will the authors be held liable for any damages arising from the use of this software.

View file

@ -5,7 +5,7 @@
* This example has been created using raylib 1.3 (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) * 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)
* *
********************************************************************************************/ ********************************************************************************************/

View file

@ -4,10 +4,10 @@
* *
* NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) * 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) * 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)
* *
********************************************************************************************/ ********************************************************************************************/

View file

@ -13,6 +13,7 @@
#define MAX_PARTICLES 200 #define MAX_PARTICLES 200
// Particle structure with basic data
typedef struct { typedef struct {
Vector2 position; Vector2 position;
Color color; Color color;

View file

@ -35,6 +35,7 @@ int main()
int width = 1024; int width = 1024;
int height = 1024; int height = 1024;
// Dynamic memory allocation to store pixels data (Color type)
Color *pixels = (Color *)malloc(width*height*sizeof(Color)); Color *pixels = (Color *)malloc(width*height*sizeof(Color));
for (int y = 0; y < height; y++) for (int y = 0; y < height; y++)
@ -50,6 +51,8 @@ int main()
Image checkedIm = LoadImageEx(pixels, width, height); Image checkedIm = LoadImageEx(pixels, width, height);
Texture2D checked = LoadTextureFromImage(checkedIm); Texture2D checked = LoadTextureFromImage(checkedIm);
UnloadImage(checkedIm); // Unload CPU (RAM) image data UnloadImage(checkedIm); // Unload CPU (RAM) image data
// Dynamic memory must be freed after using it
free(pixels); // Unload CPU (RAM) pixels data free(pixels); // Unload CPU (RAM) pixels data
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------

View file

@ -2,7 +2,7 @@
* *
* raylib [textures] example - Texture loading and drawing a part defined by a rectangle * 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) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
* *
* Copyright (c) 2014 Ramon Santamaria (@raysan5) * Copyright (c) 2014 Ramon Santamaria (@raysan5)

View file

@ -2,10 +2,10 @@
* *
* raylib [textures] example - Texture source and destination rectangles * 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) * 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)
* *
********************************************************************************************/ ********************************************************************************************/

View file

@ -4,10 +4,10 @@
* *
* NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) * 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) * 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)
* *
********************************************************************************************/ ********************************************************************************************/