OpenGL *.spec files and other Ada stuff

Hi,

It’s been a while since my last foray into OpenGL and have started working in Ada (yes that was my site on the news page :smiley: ).

Anyway, I just downloaded and converted (by hand :rolleyes: ) the latest version of the GLext.h - not complete yet.

Now, I noticed a reference to spec files which are used to generate these files, and was wondering where I can get them. I know they were in the OpenGL SI, but I can’t find a link to it, and the last time I did find it, it hadn’t been updated in a while. Can somebody let me know what is happening with this?

Now onto something more Ada related…

I tried two ways of bringing in the CVA extension in Ada, and both seem to work, but I need to know if it will work across platforms (I work under Linux with GNAT from GCC-3.4.0).

The first way is to use GetProcAddress (I’m using SDL) and this works fine.

The second is to use Ada’s C importing pragma’s; this works, but I need to know if it will be portable. As far as I know, the lines:

procedure glUnlockArraysEXT;
pragma Import(C, glUnlockArraysEXT, “glUnlockArraysEXT”);

will declare the function as an external function and bring it in, it is not a pointer type, like you would expect to use in C and I didn’t think that the GL libs made this available. Does anyone know if this will work under other compilers on other OSes?

Thanks,
Luke.

Do you mean that?
http://oss.sgi.com/projects/ogl-sample/registry/

Originally posted by Corrail:
Do you mean that?
http://oss.sgi.com/projects/ogl-sample/registry/

No. Like I said, there is a reference to *.spec files (somewhere here) that are used to generate the glext.h header files.

Luke.

http://oss.sgi.com/cgi-bin/cvsweb.cgi/projects/ogl-sample/main/doc/registry/specs/

You can reach the source tree from here too.

http://oss.sgi.com/projects/ogl-sample/contribute.html

I got this with a google for “OpenGL spec files”.

There is also a partial XML version in the Mesa source code. It’s in Mesa CVS in src/mesa/glapi/gl_API.XML. It only covers the function entry points and types currently (i.e., very, very few enums are in it), but it is completely extensible. The idea was to make a file that was easier to parse (there are sample Python scripts in that same directory) and allow generation of various API dispatch related functions and GLX protocol functions for Mesa and XFree86.

I believe that the guys at Delphi3D have something similar to generate GL API code for Delphi.

However, for anything that is an extension, you MUST use the platform’s GetProcAddress. If you don’t, you can be 100% guaranteed to not work on Windows or on systems with an older libGL installed (that my not export the symbols).

Originally posted by idr:
[b]There is also a partial XML version in the Mesa source code. It’s in Mesa CVS in src/mesa/glapi/gl_API.XML. It only covers the function entry points and types currently (i.e., very, very few enums are in it), but it is completely extensible. The idea was to make a file that was easier to parse (there are sample Python scripts in that same directory) and allow generation of various API dispatch related functions and GLX protocol functions for Mesa and XFree86.

I believe that the guys at Delphi3D have something similar to generate GL API code for Delphi.
[/b]
Yup, this is soemthing that would be useful for Ada as well. Hand coding this stuff is a pain.


However, for anything that is an extension, you MUST use the platform’s GetProcAddress. If you don’t, you can be 100% guaranteed to not work on Windows or on systems with an older libGL installed (that my not export the symbols).

Yeah, that’s what I thought. Shame really, because using the import pragma, made it really easy :smiley:

Thanks,
Luke.