Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.30 (FreeBSD)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 550 - File: global.php PHP 8.1.30 (FreeBSD)
File Line Function
/global.php 550 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.30 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.30 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 26 - File: global.php(872) : eval()'d code PHP 8.1.30 (FreeBSD)
File Line Function
/global.php(872) : eval()'d code 26 errorHandler->error
/global.php 872 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key 1 - Line: 866 - File: inc/class_parser.php PHP 8.1.30 (FreeBSD)
File Line Function
/inc/class_parser.php 866 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP]   postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/printthread.php 179 postParser->parse_message
Warning [2] Undefined array key 1 - Line: 885 - File: inc/class_parser.php PHP 8.1.30 (FreeBSD)
File Line Function
/inc/class_parser.php 885 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP]   postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/printthread.php 179 postParser->parse_message
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error

Tutorial #03: Pong - "Dashed Midline" doesn't need of AddGraphNode? - Printable Version
The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.30 (FreeBSD)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 550 - File: global.php PHP 8.1.30 (FreeBSD)
File Line Function
/global.php 550 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.30 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.30 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 26 - File: global.php(872) : eval()'d code PHP 8.1.30 (FreeBSD)
File Line Function
/global.php(872) : eval()'d code 26 errorHandler->error
/global.php 872 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key 1 - Line: 866 - File: inc/class_parser.php PHP 8.1.30 (FreeBSD)
File Line Function
/inc/class_parser.php 866 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP]   postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/printthread.php 179 postParser->parse_message
Warning [2] Undefined array key 1 - Line: 885 - File: inc/class_parser.php PHP 8.1.30 (FreeBSD)
File Line Function
/inc/class_parser.php 885 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP]   postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/printthread.php 179 postParser->parse_message
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.30 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error



Official Murl Engine Forum
Tutorial #03: Pong - "Dashed Midline" doesn't need of AddGraphNode? - Printable Version

+- Official Murl Engine Forum (https://murlengine.com/forum)
+-- Forum: Murl Engine (https://murlengine.com/forum/forumdisplay.php?fid=5)
+--- Forum: Tutorials (https://murlengine.com/forum/forumdisplay.php?fid=6)
+--- Thread: Tutorial #03: Pong - "Dashed Midline" doesn't need of AddGraphNode? (/showthread.php?tid=244)



Tutorial #03: Pong - "Dashed Midline" doesn't need of AddGraphNode? - Flávio San - 25 Nov 2015

Hello! Smile
I know that when I use AddGraphNode the engine does automatically clear the GraphNode when OnDeInit is called.

In the Tutorial #03: Pong the "Dashed Midline" is not using AddGraphNode, but only mBallTransform.GetReference(root, "line_"+Util::UInt32ToString(i));.

My question is: "Dashed Midline" doesn't need use AddGraphNode to clear the memory?

Tutorial #01: Cube Wrote:In order to manage references in a more comfortable way, the BaseProcessor class offers the convenient method AddGraphNode(). This method keeps track of all requested references and passes the responsibility of removing references on to the BaseProcessor itself. All tracked references are released automatically, when the BaseProcessor's destructor is called.



RE: Tutorial #03: Pong - "Dashed Midline" doesn't need of AddGraphNode? - Ketschak - 25 Nov 2015

Using AddGraphNode() has the advantage that RemoveReference() is called automatically for each node when the BaseProcessor's destructor is called and that we easily can verify if all references are valid with the AreGraphNodesValid() method.

However, in this case we ourself take care to remove the requested references:
// GetReference gets a reference and increases the reference counter
mBallTransform.GetReference(root, "line_"+Util::UInt32ToString(i));
mBallTransform->SetPositionY(-20.0 + (maxInstances/2 - i)*40);
// RemoveReference removes the reference and decreases the reference counter
mBallTransform.RemoveReference();



RE: Tutorial #03: Pong - "Dashed Midline" doesn't need of AddGraphNode? - Flávio San - 25 Nov 2015

OK! I'm still in the early tutorials and maybe I'm being rushed! From what I understand, in this example the "Dashed Midline" are just data in video memory, so, I'll just need to clear my video memory.

Murl Engine gives support for the user to make these cleanings in video memory?

(25 Nov 2015, 8:59)Ketschak Wrote: Using AddGraphNode() has the advantage that RemoveReference() is called automatically for each node when the BaseProcessor's destructor is called and that we easily can verify if all references are valid with the AreGraphNodesValid() method.

However, in this case we ourself take care to remove the requested references:
// GetReference gets a reference and increases the reference counter
mBallTransform.GetReference(root, "line_"+Util::UInt32ToString(i));
mBallTransform->SetPositionY(-20.0 + (maxInstances/2 - i)*40);
// RemoveReference removes the reference and decreases the reference counter
mBallTransform.RemoveReference();



RE: Tutorial #03: Pong - "Dashed Midline" doesn't need of AddGraphNode? - Ketschak - 25 Nov 2015

This has nothing to do with video memory.

The nodes in the scene graph can be referenced by multiple objects - e.g. the renderer, the logic class ...
We use reference counting for each node to track how many references are hold by other objects.

If you obtain a reference with GetReference() you must make sure that you also call RemoveReference() when you are finished. Thats all.

AddGraphNode() does not clear the graph node, it just collects the node and when the destructor is called, it calls RemoveReference() for each collected node. Its usually simply more convenient to use AddGraphNode() but it is not mandatory required.


RE: Tutorial #03: Pong - "Dashed Midline" doesn't need of AddGraphNode? - Flávio San - 25 Nov 2015

Ok, I will study more the engine to see how far the API allows me to do what I want.

Best Regards!

(25 Nov 2015, 19:06)Ketschak Wrote: This has nothing to do with video memory.

The nodes in the scene graph can be referenced by multiple objects - e.g. the renderer, the logic class ...
We use reference counting for each node to track how many references are hold by other objects.

If you obtain a reference with GetReference() you must make sure that you also call RemoveReference() when you are finished. Thats all.

AddGraphNode() does not clear the graph node, it just collects the node and when the destructor is called, it calls RemoveReference() for each collected node. Its usually simply more convenient to use AddGraphNode() but it is not mandatory required.