I’m new to MG/XNA and I’m just trying stuff out; this is an inventory slot, it’s supposed to be drawing the slot texture and the item icon.
The class has a method like this (pseudocode because it’s on another machine, but this is actually the whole code anyway):
void Draw() //Called by another class within the sb.Begin/sb.End pair.
spriteBatch.Draw(texture, position, color)
spriteBatch.Draw(texture, position, sourceRectangle)
// Or any other variant of it, it makes no difference.
There’s no difference if I use a single icon for every slot, or different ones, or an atlas.
If the slot draws two textures, the FPS get halved, or worse (no fixed FPS so it’s in the thousands, on the machine I’m testing this it drops from 5700 to 2200). However, if I instantiate another set of slots (same position and everything) and make each set draw only one texture, there’s no FPS drop. The code that manages the draws is the same, I just added an if/else to make each set only call one of the draws.
Couldn’t find anything about it, any idea what could be causing this?