Hi,
Perhaps some of you can help me spot some error that i am making here
Problem i am having is, that my rendering loop seems to be eating memory but i can't tell where. it seems to be taking up 20/30k every few frames. And that is irritating me to no end.
Here is how my Rendering loop looks like
pEngine->PrepareScene();
while (1)
{
if (PeekMessage(&uMsg, NULL, 0, 0, PM_REMOVE))
{
if (uMsg.message == WM_QUIT)
break;
TranslateMessage(&uMsg);
DispatchMessage(&uMsg);
}
pEngine->Cycle();
}
pEngine->DeleteScene();
this PrepareScene looks like this
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
grid = glGenLists(1);
glNewList(grid, GL_COMPILE);
glBegin(GL_LINES);
glColor3f(1.0f, 1.0f, 1.0f);
for(int i=-100; i<101; i++)
{
glVertex3i(i, 0, -100);
glVertex3i(i, 0, 100);
glVertex3i(-100, 0, i);
glVertex3i(100, 0, i);
}
glEnd();
glEndList();
So its a pretty simple DisplayList, just a plain simple Grid.
And the Cycle method has following
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
glLoadIdentity();
gluLookAt(0.0, 1.0, -5.0,
0.0, 0.0, 5.0,
0.0, 1.0, 0.0);
glPushMatrix();
glListBase(grid);
glCallList(grid);
glPopMatrix();
glFlush();
SwapBuffers(m_pWindow->GetHDC());
It seems to be eating memory during the Cycle function. But i can't figure out why.
I read a few thread about wglMakeCurrent doing similar things, But that function isn't in my render loop. And i can't figure out what i am missing.