[Lazarus] RE : New widgetset

Michalis Kamburelis michalis.kambi at gmail.com
Tue Aug 16 20:08:18 CEST 2011


Ludo Brands wrote:
> Tried the example but it crashes with a segfault at line 31 in
> nvShaderUtils. It appears that the address of glCreateShader is nil. I tried
> to break into any of the Load_GL_VERSION_x_y or glext_LoadExtension in
> glext.pp but no success. When are functions like glCreateShader supposed to
> be initialised?
>
> Ubuntu 10.04 OpenGL 2.1, shading language version 1.2
>

glCreateShader is initialized by Load_GL_version_2_0 (also, higher
Load_GL_version_x_x call Load_GL_version_2_0).

Darius: nvidia-widgets/src/nvwidgets/nvglutwidgets.pas calls
Load_GL_version_2_0, but the result is not checked. You should abort
the program (probably it would be nicest to raise an exception) if
Load_GL_version_2_0 returns false (meaning that some entry points are
not defined). Since the rest of the code seems to assume that GLSL
functions are initialized.

Ludo: Are you sure you have OpenGL 2.1? Some OpenGL implementations
unfortunately lie, claiming in glGetString(GL_VERSION) that they
support higher version than in reality. You can try adding
Writeln(Load_GL_version_2_0) into any OpenGL example program, and you
will probably see that it answers false. For example, you can add
Writeln(Load_GL_version_2_0) inside the FPC demo
packages/opengl/examples/glutdemo.pp, near the other writelns.

Michalis




More information about the Lazarus mailing list