Managed DirectX Sprite Scaling
-
I have a DirectX environment going and working beautifully. I also found a way to get frames per second and that is working too. I am using DirectX Sprites to draw everything. Now, the problem is with scaling the sprites. If I have about 30 scaled sprites, I nearly halve my framerate. I know the problem lies with having to scale it everytime I draw it, any ideas?
// do not draw if not visible if (!bVisible) { return; } // Apply any scaling necessary if (!bScaled) { AdjustScaling(); bScaled = true; } //TODO: this kills framerate need to figure out how to do this just once sprite.Transform = scaling; // Draw the sprite //Reminder: Error here usually means you arn't between start and end scene sprite.Draw(texture, sourcerectangle, center, position, color);
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo