aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2015-07-18 19:26:13 +0200
committerraysan5 <raysan5@gmail.com>2015-07-18 19:26:13 +0200
commit067b884f395b7b6d4c179cb3d58b0d17a02950ec (patch)
treeb6075ae3689cb345c27f0358bc814b48596b3877 /examples
parenta98578c91db7d51233ae56e599dd4a3b2244cd0c (diff)
downloadraylib-067b884f395b7b6d4c179cb3d58b0d17a02950ec.tar.gz
raylib-067b884f395b7b6d4c179cb3d58b0d17a02950ec.zip
Updated examples for next raylib version
Diffstat (limited to 'examples')
-rw-r--r--examples/models_cubicmap.c8
-rw-r--r--examples/models_heightmap.c8
-rw-r--r--examples/models_planes.c3
-rw-r--r--examples/textures_compressed_dds.c4
-rw-r--r--examples/textures_image_loading.c6
-rw-r--r--examples/textures_mipmaps.c4
6 files changed, 16 insertions, 17 deletions
diff --git a/examples/models_cubicmap.c b/examples/models_cubicmap.c
index 60e93c6d..62f7b076 100644
--- a/examples/models_cubicmap.c
+++ b/examples/models_cubicmap.c
@@ -23,13 +23,13 @@ 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/cubicmap.png"); // Load cubesmap image (RAM)
- Texture2D texture = LoadTextureFromImage(img, false); // Convert image to texture (VRAM)
- Model map = LoadCubicmap(img); // Load cubicmap model
+ Image image = LoadImage("resources/cubicmap.png"); // Load cubesmap image (RAM)
+ Texture2D texture = LoadTextureFromImage(image); // Convert image to texture (VRAM)
+ Model map = LoadCubicmap(image); // Load cubicmap model (generate model from image)
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
+ UnloadImage(image); // Unload cubesmap image from RAM, already uploaded to VRAM
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
diff --git a/examples/models_heightmap.c b/examples/models_heightmap.c
index 7121c261..a23656a5 100644
--- a/examples/models_heightmap.c
+++ b/examples/models_heightmap.c
@@ -23,13 +23,13 @@ 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 = LoadTextureFromImage(img, false); // Convert image to texture (VRAM)
- Model map = LoadHeightmap(img, 4); // Load heightmap model
+ Image image = LoadImage("resources/heightmap.png"); // Load heightmap image (RAM)
+ Texture2D texture = LoadTextureFromImage(image); // Convert image to texture (VRAM)
+ Model map = LoadHeightmap(image, 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
+ UnloadImage(image); // Unload heightmap image from RAM, already uploaded to VRAM
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
diff --git a/examples/models_planes.c b/examples/models_planes.c
index b0a6b878..58b5137e 100644
--- a/examples/models_planes.c
+++ b/examples/models_planes.c
@@ -42,8 +42,7 @@ int main()
Begin3dMode(camera);
- DrawPlane((Vector3){ 0, 0, 0 }, (Vector2){ 4, 4 }, (Vector3){ 0, 45, 0 }, RED);
- //DrawPlaneEx((Vector3){ 0, 8, 0 }, (Vector2){ 2, 1 }, (Vector3){ 0, 0, 0 }, 4, 4, SKYBLUE);
+ DrawPlane((Vector3){ 0, 0, 0 }, (Vector2){ 4, 4 }, RED); // Draw a plane XZ
DrawGrid(10.0, 1.0);
diff --git a/examples/textures_compressed_dds.c b/examples/textures_compressed_dds.c
index d2ba58c8..1092d5ca 100644
--- a/examples/textures_compressed_dds.c
+++ b/examples/textures_compressed_dds.c
@@ -24,8 +24,8 @@ int main()
InitWindow(screenWidth, screenHeight, "raylib [textures] example - DDS texture loading and drawing");
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
- //Texture2D texture = LoadTexture("resources/raylib_logo.dds"); // Texture loading (compressed)
- Texture2D texture = LoadTexture("resources/raylib_logo_uncompressed.dds"); // Texture loading (uncompressed)
+
+ Texture2D texture = LoadTexture("resources/raylib_logo.dds"); // Texture loading (compressed)
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//---------------------------------------------------------------------------------------
diff --git a/examples/textures_image_loading.c b/examples/textures_image_loading.c
index b7fc2cfc..7c6aae52 100644
--- a/examples/textures_image_loading.c
+++ b/examples/textures_image_loading.c
@@ -24,10 +24,10 @@ 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 = LoadTextureFromImage(img, false); // Image converted to texture, GPU memory (VRAM)
+ Image image = LoadImage("resources/raylib_logo.png"); // Loaded in CPU memory (RAM)
+ Texture2D texture = LoadTextureFromImage(image); // 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
+ UnloadImage(image); // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM
//---------------------------------------------------------------------------------------
// Main game loop
diff --git a/examples/textures_mipmaps.c b/examples/textures_mipmaps.c
index d3ba1708..6b7a64f0 100644
--- a/examples/textures_mipmaps.c
+++ b/examples/textures_mipmaps.c
@@ -24,10 +24,10 @@ int main()
InitWindow(screenWidth, screenHeight, "raylib [textures] example - texture mipmaps generation");
// NOTE: To generate mipmaps for an image, image must be loaded first and converted to texture
- // with mipmaps option set to true on CreateTexture()
Image image = LoadImage("resources/raylib_logo.png"); // Load image to CPU memory (RAM)
- Texture2D texture = LoadTextureFromImage(image, true); // Create texture and generate mipmaps
+ Texture2D texture = LoadTextureFromImage(image); // Load texture into GPU memory (VRAM)
+ GenTextureMipmaps(texture); // Generate mipmaps for texture
UnloadImage(image); // Once texture has been created, we can unload image data from RAM
//--------------------------------------------------------------------------------------