Original Post
Is it ok in c# to declare primitive variables and loop control variables inside a render loop, or does this eat memory? the code below for example, which just outputs some text to the screen. Is the new Rectangle(...) part going to create a new memory location each time the code is executed, or will it be done only once.
//to draw text inscreen co-ordinates
private void Draw2DText(string text,Color c,float pos)
{
int x = this.Width/22;
float y = (float) this.Height/pos;
int yInt = (int) Math.Round(y,0);
font.DrawText(textSprite, text, new Rectangle(x, yInt,
this.Width , this.Height ),
DrawTextFormat.NoClip | DrawTextFormat.ExpandTabs |
DrawTextFormat.WordBreak , c);
}