I'm getting them on these to variables in the function(also in the header for the part commented out). I've accolated the memory for them at the top of the source file, is there something I'm missing here? using mingw 4.6.2 and c++0x.

And that was it... derp. I wasn't sure but It wasn't giving a compile error so I never would of figured that out

EDIT: ugh since I added 2 static variables my memory usage went from 41 mb to 250mb . Heres my dilemma. I have tooltips for my ui elements. Each object has a class tool tip and the tooltip class in each object manages when they should display. But since they draw in the objects draw function the objects are drawing in different orders when I draw all my objects that need to be drawn some tooltips are under other images so you can't see them. So the first thing I thought of is to have a static bitmap in the tooltip class so that when a tooltip should be drawn I draw it to that bitmap instead then I call a static function of tooltip at the end of all drawing make it so that the tooltip is always drawn last. Does anyone have a better solution

It was a 1200x700 px static bitmap and a boolean variable. I got rid of them and back down to 41 mb. it was probably more than the variables taking up the space probably the stuff I was doing with them. I need to learn to hate static variables last time I used them they made my program use like 4Gb of memory and crash... that gave me a good laugh at least

The drawing order, thats how my library works I'm trying to integrate a way to make the tooltips draw last. Before I tried to use a static variable that I drew on the size of the screen then drew it last.

Well, in my GUI library, every widget class is derived from a base widget class. This allows you to make vectors of WidgetBase*'s. After that you can sort them however you want, especially for a drawing order. Need to draw on top? Move it to the bottom of the list.

For you, I suppose your GUI could have something like a current Tooltip*, that it just draws last no matter what. Have your buttons or whatever uses a tool tip set the current GUI tooltip and then let it draw it.