Examples review...

This commit is contained in:
raysan5 2015-01-02 20:58:06 +01:00
parent e6bc655d6a
commit 8847602061
9 changed files with 26 additions and 16 deletions

View File

@ -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
//--------------------------------------------------------------------------------------

View File

@ -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)
*

View File

@ -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

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -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

View File

Before

Width:  |  Height:  |  Size: 173 B

After

Width:  |  Height:  |  Size: 173 B

View File

@ -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
//---------------------------------------------------------------------------------------

View File

@ -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
//--------------------------------------------------------------------------------------

View File

@ -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)
*