aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2014-07-08 10:33:04 +0200
committerraysan5 <raysan5@gmail.com>2014-07-08 10:33:04 +0200
commit5e2e9aa23e1fcbc78395443a4b0f83404b5557f8 (patch)
tree09f4a4ca952186035f4d7d9fd0c0914dbd0160e4 /examples
parentaff8d151a444f43a19601e97637239cb09c065a3 (diff)
downloadraylib-5e2e9aa23e1fcbc78395443a4b0f83404b5557f8.tar.gz
raylib-5e2e9aa23e1fcbc78395443a4b0f83404b5557f8.zip
Corrected bug with DrawModel()
Diffstat (limited to 'examples')
-rw-r--r--examples/ex07c_3d_models.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/ex07c_3d_models.c b/examples/ex07c_3d_models.c
index e3276b45..25861b1a 100644
--- a/examples/ex07c_3d_models.c
+++ b/examples/ex07c_3d_models.c
@@ -29,6 +29,7 @@ int main()
Texture2D texture = LoadTexture("resources/catwhite.png");
Model cat = LoadModel("resources/cat.obj");
+ SetModelTexture(&cat, texture); // Link texture to model
//--------------------------------------------------------------------------------------
// Main game loop
@@ -36,10 +37,10 @@ int main()
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyPressed(KEY_LEFT)) position.x -= 0.2;
- if (IsKeyPressed(KEY_RIGHT)) position.x += 0.2;
- if (IsKeyPressed(KEY_UP)) position.z -= 0.2;
- if (IsKeyPressed(KEY_DOWN)) position.z += 0.2;
+ if (IsKeyDown(KEY_LEFT)) position.x -= 0.2;
+ if (IsKeyDown(KEY_RIGHT)) position.x += 0.2;
+ if (IsKeyDown(KEY_UP)) position.z -= 0.2;
+ if (IsKeyDown(KEY_DOWN)) position.z += 0.2;
//----------------------------------------------------------------------------------
// Draw
@@ -50,11 +51,11 @@ int main()
Begin3dMode(camera);
- DrawModelEx(cat, texture, position, 0.1f, WHITE); // Draw 3d model with texture
+ DrawModel(cat, position, 0.1f, WHITE); // Draw 3d model with texture
DrawGrid(10.0, 1.0); // Draw a grid
- DrawGizmo(position, false);
+ DrawGizmo(position);
End3dMode();