summaryrefslogtreecommitdiffhomepage
path: root/examples/textures/textures_to_image.c
diff options
context:
space:
mode:
authorRay <[email protected]>2019-05-20 16:36:42 +0200
committerRay <[email protected]>2019-05-20 16:36:42 +0200
commitb525039e0ab8bcaa2fd6bde34c72a6405f88ae49 (patch)
tree08f1c79bfe693643564ed78202c9474b7eb83a79 /examples/textures/textures_to_image.c
parenta43a7980a30a52462956b23f2473e8ef8f38d1fb (diff)
downloadraylib-b525039e0ab8bcaa2fd6bde34c72a6405f88ae49.tar.gz
raylib-b525039e0ab8bcaa2fd6bde34c72a6405f88ae49.zip
Review ALL examples
Diffstat (limited to 'examples/textures/textures_to_image.c')
-rw-r--r--examples/textures/textures_to_image.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/textures/textures_to_image.c b/examples/textures/textures_to_image.c
index 37c3b5a0..c0989baf 100644
--- a/examples/textures/textures_to_image.c
+++ b/examples/textures/textures_to_image.c
@@ -1,6 +1,6 @@
/*******************************************************************************************
*
-* raylib [textures] example - Retrieve image data from texture: GetTextureData()
+* raylib [textures] example - Retrieve image data from texture: GetTextureData()
*
* NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM)
*
@@ -13,12 +13,12 @@
#include "raylib.h"
-int main()
+int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
- int screenWidth = 800;
- int screenHeight = 450;
+ const int screenWidth = 800;
+ const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [textures] example - texture to image");
@@ -27,10 +27,10 @@ int main()
Image image = LoadImage("resources/raylib_logo.png"); // Load image data into CPU memory (RAM)
Texture2D texture = LoadTextureFromImage(image); // Image converted to texture, GPU memory (RAM -> VRAM)
UnloadImage(image); // Unload image data from CPU memory (RAM)
-
+
image = GetTextureData(texture); // Retrieve image data from GPU memory (VRAM -> RAM)
UnloadTexture(texture); // Unload texture from GPU memory (VRAM)
-
+
texture = LoadTextureFromImage(image); // Recreate texture from retrieved image data (RAM -> VRAM)
UnloadImage(image); // Unload retrieved image data from CPU memory (RAM)
//---------------------------------------------------------------------------------------