N00bie: crash under vista

{ glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
glVertex3f (0.25, 0.25, 0.0);
glVertex3f (0.75, 0.25, 0.0);
glVertex3f (0.75, 0.75, 0.0);
glVertex3f (0.25, 0.75, 0.0);
glEnd();
glFlush ();
}

Hey I am a newbie and trying out the tutorial
and get a crash at glClear(). here’s the disassembly :-

glClear (GL_COLOR_BUFFER_BIT);
mov esi,esp
push 4000h
call dword ptr [__imp__glClear@4 (2583E4h)]
cmp esi,esp <- crash esi:0,esp:2094716
call @ILT+380(__RTC_CheckEsp) (251181h)

I compiled it using VS20008.

Did you create a window and a context?

don’t know about context, but I have created a window.

hi,

as long as you have no valid opengl context, your opengl functions ( glClear() etc ) are not initialized at all, and point to nowhere/zero.

try eg. glut or something similar to create
a window with a valid opengl context.

best,
hendrik

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.