nobody wrote on Sunday, April 27, 2008:
Hi,
I really love GLFW. It is so compact and stable. Now I wanted to start a big project (a remake of an old Retro Game^^)
under Windows Vista with VS8. So I compiled a static GLFW-Lib 2.6 for that and started to code. All works fine,
like it works on Linux or WindowsXP. But there is a strange behavior with my GLFW-Program. If I look into
the Taskmanager then I can see, that my Program eats my memory. The memory-usage increases each 1-2 seconds
by 2-4 KByte and this doesn’t stop! I have compared this behavior with an old Programm I wrote under VS 2003 und WindowsXP and this programm works fine and has not this behavior. Has somebody an idea what I can do ?
I will not fallback to glut
Here is one sample Programm I compile and which has got this strange behavior:
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "GLFW/glfw.h"
void Draw( void )
{
int width, height;
double t;
t = glfwGetTime();
glfwGetWindowSize( &width, &height );
height = height < 1 ? 1 : height;
glViewport( 0, 0, width, height );
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glMatrixMode\( GL\_PROJECTION \);
glLoadIdentity\(\);
gluPerspective\(
65.0,
\(double\)width/\(double\)height,
1.0,
100.0
\);
glMatrixMode\( GL\_MODELVIEW \);
glLoadIdentity\(\);
gluLookAt\(
0.0, 0.0, 10.0,
0.0, 0.0, 0.0,
0.0, 1.0, 0.0
\);
glBegin\( GL\_TRIANGLES \);
glColor3f\( 1.0f, 0.0f, 0.0f \);
glVertex3f\( -5.0f, -4.0f, 0.0f \);
glColor3f\( 0.0f, 1.0f, 0.0f \);
glVertex3f\( 5.0f, -4.0f, 0.0f \);
glColor3f\( 0.0f, 0.0f, 1.0f \);
glVertex3f\( 0.0f, 4.5f, 0.0f \);
glEnd\(\);
}
int main( int argc, char **argv )
{
int ok;
int running;
glfwInit\(\);
ok = glfwOpenWindow\(640, 480,8, 8, 8, 8,24,0,GLFW\_WINDOW\);
if\( \!ok \)
\{
glfwTerminate\(\);
return 0;
\}
glfwSetWindowTitle\( "My OpenGL program" \);
glfwEnable\( GLFW\_STICKY\_KEYS \);
do
\{
Draw\(\);
glfwSwapBuffers\(\);
running = \!glfwGetKey\( GLFW\_KEY\_ESC \) &&
glfwGetWindowParam\( GLFW\_OPENED \);
\}
while\( running \);
glfwTerminate\(\);
return 0;
}
More Infos:
Environment: VS 8
Full Optimization (/Ox)
Runttime Library: Multi-threaded (/MT)
Additional Library directories: :\Users\xxx\Desktop\Retro2D\GLFW (Here is the static library glfw.lib, glfw.h)
Additional Dependencies: glfw.lib opengl32.lib glu32.lib
Entry Point: mainCRTStartup
My System:
Intel Core 2 Quad 2,4 GHZ
2048 MB Ram (666MHZ)
Windows Vista
Graphiccard: Geforce 8500 GT
Driver: 169.25_forceware_winvista_32bit_international_whql.exe
Thanks for all help
Greetz
fbrjogl