[fpc-pascal] dglOpenGL <-> GL, GLu, GLExtt

Marco van de Voort marcov at stack.nl
Sat Feb 23 15:36:08 CET 2013

In our previous episode, Juha Manninen said:
> I didn't quite understand what is load<something with glversion>.

A function loadgl4.1 or loadglext4.1 or so. There was one for each version
in glext to preload certain extensions (which afaik you can only load if you
have created a proper context)
> My experiments advance slowly. The original DeleD code validate OpenGL
> by checking if
>     @glActiveTextureARB, @glClientActiveTextureARB and @glMultiTexCoord2fARB
> are assigned.
> With dglopengl it stops working when I replace
>   H_RC := wglCreateContext(H_DC);
> with the cross-platform OpenGLContext:
>   fOpenGLControl1:=TOpenGLControl.Create(Self);
> and replace
>   wglMakeCurrent(H_DC, H_RC);
> with
>   OpenGLControl1.MakeCurrent;

>From what I see it is TWSOpenGLControl.CreateHandle that creates the
context. Put a breakpoint on the lopenglcreatecontext function and make sure
you hit the breakpoint when you create the topenglcontrol. I don't know
what these WS components are good for.

Note also that openglcontrol seems to use its own headers (at least on
Windows). I've only used opengl on Windows though (its for work)

More information about the fpc-pascal mailing list