I'm creating small engine/framework for making games. It's kind of simple question but I haven't found an answer so I'd like to consult you.
There are some classes derived from Graphic with the Draw(...) function. Draw() will be called dozens or maybe even hundreds of times (if there are many sprites to render). Draw() is too big to be inline (10-20 lines).
I'd like it to be virtual (sometimes but rather rarely I'll be using polymorphism*). I think it shouldn't affect greatly on performance but do you think it should be virtual?
Should it have some arguments (2-6) describing position to render (etc)? I don't have an idea if passing many arguments will make it slower. Maybe every drawable object should have its own position/area data?
The most important question is 2.
*ex. with animations
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)