I have been trying to make my rendering engine faster, and while i have had some success there is still something that bothers me. When I run a profiler on my code it turns out that a large percentage of the processing power goes towards calling al_d3d_create_bitmap. Considering that I don't start the profiler until after everything is initialized I can't figure out why this function is showing up at all.
Relevent Code:
Initialize
Drawing:
al_clear_to_color(bgClearClr); for(unsigned int i=0;i<renderList.size();i++) { al_draw_tinted_scaled_rotated_bitmap_region(renderList[i].SpriteSheet, renderList[i].SpriteBox.X1,renderList[i].SpriteBox.Y1,renderList[i].SpriteBox.W,renderList[i].SpriteBox.H, renderList[i].Tint, renderList[i].SpriteBox.X1+renderList[i].SpriteBox.W/2.0,renderList[i].SpriteBox.Y1+renderList[i].SpriteBox.H/2.0, renderList[i].DrawBox.X1,renderList[i].DrawBox.Y1, renderList[i].DrawBox.W/renderList[i].SpriteBox.W, renderList[i].DrawBox.H/renderList[i].SpriteBox.H, renderList[i].Rotation,0); } renderList.clear(); al_flip_display();