tags:

views:

54

answers:

1

I'm using OpenGL to render polygons. I notice that if I minimize the program then start using it again, it will be very slow for a few seconds. (I'm guessing its reuploading my display lists to the card). How can I prevent this because it's a bit annoying. I want it to always have the contents.

Thanks

+1  A: 

When you minimize a program under Windows, it does the equivalent of SetProcessWorkingSetSize(current_process, -1,-1);. This tells the virtual memory manager that all the memory occupied by that program is eligible for being paged out. The only way I know of to prevent this is to prevent the user from minimizing the program in the first place (e.g., use DeleteMenu to remove the "minimize" item from its system menu).

Note that this isn't a matter of your program's drawing data being removed from the graphics card -- it's a matter of all its data (and quite possibly code) being removed from memory entirely. Of course, if you have enough memory and a lightly enough loaded system, it won't be removed immediately -- it's just marked as being available, so if the system needs memory for something else, it will be (some of) the first to get used.

Jerry Coffin