I've created a simple opengl program on Windows 7 using WIN api.
I've setup the window by following the tutorial on MSDN win api website. The window works perfectly, even with input logging it does not leak any memory and works alright stays at 1.7 MB of ram.
With opengl context it takes 11MB.
If i want to draw something like Rectangle it begins to leak by 200 kb. (The rectangle draws perfectly fine....)
It starts at 14.5 MB and grows up to 50MB and continues.
There are no 'new' keywords in the whole program, it is very simple program. Only create window. Than while loop in which the rendering is done...
Here is the main.
int main()
{
Window wind(800,600);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
while(!wind.isCloseRequested())
{
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
Vector3f Vertices[3];
Vertices[0] = Vector3f(-1.0f, -1.0f, 0.0f);
Vertices[1] = Vector3f(1.0f, -1.0f, 0.0f);
Vertices[2] = Vector3f(0.0f, 1.0f, 0.0f);
GLuint VBO;
glGenBuffers(1, &VBO);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(Vertices), Vertices, GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
glDrawArrays(GL_TRIANGLES, 0, 3);
glDisableVertexAttribArray(0);
wind.update();
Sleep(16);
}
wind.Destroy();
return 0;
}