i found the problem, you are not calling InitOpenGL from dglOpenGL.

as you are using this same procedure name for the engine, just use "dglOpenGl."

put
[pascal] dglOpenGL.InitOpenGL();
dglOpenGL.ReadExtensions();[/pascal]
at the beginning of the procedure
procedure initOpenGL(width, height, fps: integer);