PDA

View Full Version : OpenGL *.spec files and other Ada stuff



Lucretia
06-28-2004, 01:03 AM
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 :D ).

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.

Corrail
06-28-2004, 02:09 AM
Do you mean that?
http://oss.sgi.com/projects/ogl-sample/registry/

Lucretia
06-28-2004, 04:36 AM
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.

NitroGL
06-28-2004, 06:59 AM
http://oss.sgi.com/cgi-bin/cvsweb.cgi/projects/ogl-sample/main/doc/registry/specs/

plasmonster
06-28-2004, 07:31 AM
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".

idr
06-28-2004, 08:11 AM
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 (http://www.delphi3d.net/) 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).

Lucretia
06-28-2004, 11:59 PM
Originally posted by idr:
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 (http://www.delphi3d.net/) have something similar to generate GL API code for Delphi.
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 :D

Thanks,
Luke.