Here's the loop that seems to be what is causing the leak. I can't say it's really a memory leak, but I can't think of any other reason why the memory would continuously increase.
while(!done) // Loop That Runs While done=FALSE
{
while(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
if(msg.message == WM_QUIT)
{
done = true;
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
// Draw The Scene. Watch For ESC Key And Quit Messages From DrawGLScene()
if (active && !Tick()/*Replace this with Tick()*/) // Active? Was There A Quit Received?
{
done=true; // ESC or DrawGLScene Signalled A Quit
}
else // Not Time To Quit, Update Screen
{
SwapBuffers(hDC); // Swap Buffers (Double Buffering)
}
}
The code for "Tick()" is here:
int Tick()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
return 1;
}
I just copied some of the code from one of NeHe's tutorials.
Is it possible that I have a memory leak, or is it normal for the memory to do this?