From 8847602061d964592c468757eb535770771af1f0 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 2 Jan 2015 20:58:06 +0100 Subject: [PATCH] Examples review... --- examples/audio_music_stream.c | 2 +- examples/core_basic_window.c | 10 ++++++++++ examples/models_cubicmap.c | 12 ++++++------ .../{models_cubesmap.png => models_cubicmap.png} | Bin examples/models_heightmap.c | 10 +++++----- examples/resources/{cubesmap.png => cubicmap.png} | Bin examples/textures_image_loading.c | 4 ++-- examples/textures_mipmaps.c | 2 +- src/rlgl.h | 2 +- 9 files changed, 26 insertions(+), 16 deletions(-) rename examples/{models_cubesmap.png => models_cubicmap.png} (100%) rename examples/resources/{cubesmap.png => cubicmap.png} (100%) diff --git a/examples/audio_music_stream.c b/examples/audio_music_stream.c index 5fd4a0549..560347e6a 100644 --- a/examples/audio_music_stream.c +++ b/examples/audio_music_stream.c @@ -27,8 +27,8 @@ int main() PlayMusicStream("resources/audio/guitar_noodling.ogg"); // Play music stream int framesCounter = 0; - float volume = 1.0; float timePlayed = 0; + //float volume = 1.0; SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- diff --git a/examples/core_basic_window.c b/examples/core_basic_window.c index 505d8df47..c6ad8445c 100644 --- a/examples/core_basic_window.c +++ b/examples/core_basic_window.c @@ -2,6 +2,16 @@ * * raylib [core] example - Basic window * +* Welcome to raylib! +* +* To test examples, just press F6 and execute raylib_compile_execute script +* Note that compiled executable is placed in the same folder as .c file +* +* You can find all basic examples on C:\raylib\raylib\examples folder or +* raylib official webpage: www.raylib.com +* +* Enjoy using raylib. :) +* * This example has been created using raylib 1.0 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * diff --git a/examples/models_cubicmap.c b/examples/models_cubicmap.c index 08398ad46..60e93c6da 100644 --- a/examples/models_cubicmap.c +++ b/examples/models_cubicmap.c @@ -1,6 +1,6 @@ /******************************************************************************************* * -* raylib [models] example - Cubesmap loading and drawing +* raylib [models] example - Cubicmap loading and drawing * * This example has been created using raylib 1.2 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) @@ -23,11 +23,11 @@ int main() // Define the camera to look into our 3d world Camera camera = {{ 7.0, 7.0, 7.0 }, { 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0 }}; - Image img = LoadImage("resources/cubesmap.png"); // Load cubesmap image (RAM) - Texture2D texture = CreateTexture(img, false); // Convert image to texture (VRAM) - Model map = LoadCubesmap(img); // Load cubesmap model - SetModelTexture(&map, texture); // Bind texture to model - Vector3 mapPosition = { -1, 0.0, -1 }; // Set model position + Image img = LoadImage("resources/cubicmap.png"); // Load cubesmap image (RAM) + Texture2D texture = LoadTextureFromImage(img, false); // Convert image to texture (VRAM) + Model map = LoadCubicmap(img); // Load cubicmap model + SetModelTexture(&map, texture); // Bind texture to model + Vector3 mapPosition = { -1, 0.0, -1 }; // Set model position UnloadImage(img); // Unload cubesmap image from RAM, already uploaded to VRAM diff --git a/examples/models_cubesmap.png b/examples/models_cubicmap.png similarity index 100% rename from examples/models_cubesmap.png rename to examples/models_cubicmap.png diff --git a/examples/models_heightmap.c b/examples/models_heightmap.c index 6e807b8c5..7121c2615 100644 --- a/examples/models_heightmap.c +++ b/examples/models_heightmap.c @@ -23,11 +23,11 @@ int main() // Define the camera to look into our 3d world Camera camera = {{ 10.0, 12.0, 10.0 }, { 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0 }}; - Image img = LoadImage("resources/heightmap.png"); // Load heightmap image (RAM) - Texture2D texture = CreateTexture(img, false); // Convert image to texture (VRAM) - Model map = LoadHeightmap(img, 4); // Load heightmap model - SetModelTexture(&map, texture); // Bind texture to model - Vector3 mapPosition = { -4, 0.0, -4 }; // Set model position + Image img = LoadImage("resources/heightmap.png"); // Load heightmap image (RAM) + Texture2D texture = LoadTextureFromImage(img, false); // Convert image to texture (VRAM) + Model map = LoadHeightmap(img, 4); // Load heightmap model + SetModelTexture(&map, texture); // Bind texture to model + Vector3 mapPosition = { -4, 0.0, -4 }; // Set model position UnloadImage(img); // Unload heightmap image from RAM, already uploaded to VRAM diff --git a/examples/resources/cubesmap.png b/examples/resources/cubicmap.png similarity index 100% rename from examples/resources/cubesmap.png rename to examples/resources/cubicmap.png diff --git a/examples/textures_image_loading.c b/examples/textures_image_loading.c index 179cf84c9..b7fc2cfca 100644 --- a/examples/textures_image_loading.c +++ b/examples/textures_image_loading.c @@ -24,8 +24,8 @@ int main() // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required) - Image img = LoadImage("resources/raylib_logo.png"); // Loaded in CPU memory (RAM) - Texture2D texture = CreateTexture(img, false); // Image converted to texture, GPU memory (VRAM) + Image img = LoadImage("resources/raylib_logo.png"); // Loaded in CPU memory (RAM) + Texture2D texture = LoadTextureFromImage(img, false); // Image converted to texture, GPU memory (VRAM) UnloadImage(img); // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM //--------------------------------------------------------------------------------------- diff --git a/examples/textures_mipmaps.c b/examples/textures_mipmaps.c index ee79f5133..d3ba1708f 100644 --- a/examples/textures_mipmaps.c +++ b/examples/textures_mipmaps.c @@ -27,7 +27,7 @@ int main() // with mipmaps option set to true on CreateTexture() Image image = LoadImage("resources/raylib_logo.png"); // Load image to CPU memory (RAM) - Texture2D texture = CreateTexture(image, true); // Create texture and generate mipmaps + Texture2D texture = LoadTextureFromImage(image, true); // Create texture and generate mipmaps UnloadImage(image); // Once texture has been created, we can unload image data from RAM //-------------------------------------------------------------------------------------- diff --git a/src/rlgl.h b/src/rlgl.h index 5fa9c4862..b42b388b0 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -5,7 +5,7 @@ * raylib now uses OpenGL 1.1 style functions (rlVertex) that are mapped to selected OpenGL version: * OpenGL 1.1 - Direct map rl* -> gl* * OpenGL 3.3+ - Vertex data is stored in VAOs, call rlglDraw() to render -* OpenGL ES 2 - Same behaviour as OpenGL 3.3+ +* OpenGL ES 2 - Vertex data is stored in VBOs or VAOs (when available), call rlglDraw() to render * * Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) *