X-Git-Url: https://git.jsancho.org/?p=c-irrlicht.git;a=blobdiff_plain;f=examples%2F03.CustomSceneNode.c;fp=examples%2F03.CustomSceneNode.c;h=9d74614cd4bccf31a0ca79ad86660d9a60fe15d6;hp=d9a161a46db2b1f873079ea0249d2efc209b5bd1;hb=75c3ceb26453f2b265c3eabdd7518d26abfeed1c;hpb=9794edd155faec29e41294c55dece45a116a3b8c diff --git a/examples/03.CustomSceneNode.c b/examples/03.CustomSceneNode.c index d9a161a..9d74614 100644 --- a/examples/03.CustomSceneNode.c +++ b/examples/03.CustomSceneNode.c @@ -68,7 +68,7 @@ int main() irr_scene_addCameraSceneNode(smgr, NULL, &position, &lookat, -1, true); // create our custom scene node - irr_scene_ISceneNode *myNode; + irr_scene_ISceneNode* myNode; irr_core_aabbox3d_f32 box; irr_video_S3DVertex vertices[] = { @@ -78,18 +78,20 @@ int main() { {0, 20, 0}, {0, 1, 1}, {255, 255, 255, 0}, {1, 0} }, { {-10, 0, -10}, {0, 0, 1}, {255, 0, 255, 0}, {0, 0} } }; - irr_video_SMaterial material = {false, false}; + irr_video_SMaterial material = S_MATERIAL_DEFAULT; + material.wireframe = false; + material.lighting = false; - irr_core_aabbox3d_reset(box, vertices[0].pos); + irr_core_aabbox3d_reset(&box, &vertices[0].pos); for (int i=1; i<4; i++) { - irr_core_aabbox3d_addInternalPoint(box, vertices[i].pos); + irr_core_aabbox3d_addInternalPoint(&box, &vertices[i].pos); } void customRender() { uint16_t indices[] = {0, 2, 3, 2, 1, 3, 1, 0, 3, 2, 0, 1}; - irr_video_setMaterial(driver, material); + irr_video_setMaterial(driver, &material); irr_video_setTransform(driver, irr_video_ETS_WORLD, irr_scene_getAbsoluteTransformation(myNode)); @@ -128,6 +130,8 @@ int main() if (anim) { irr_scene_addAnimator(myNode, anim); + irr_drop(anim); + anim = NULL; } // loop