[fetter-devel] Re: OpenGL on Windows

Kenny Tilton ktilton at nyc.rr.com
Wed Sep 21 21:32:36 UTC 2005



Rayiner Hashem wrote:

> Well, VZN CVS (as of my last commit friday afternoon) handles OpenGL 
> on Windows just fine. opengl-library is generated without problems, 
> and loads in Allegro without problems. Unfortunately, I had to modify 
> gl.h (slightly) to get it working. The gl.h/glu.h that comes with 
> VC.NET <http://VC.NET> 2005 is actually kind of broken, since it uses 
> definitions declared in windows.h (APIENTRY WINGDIAPI CALLBACK), but 
> doesn't actually include windows.h. Including windows.h in one of 
> these files results in a GCC-XML output file so large, that VZN can't 
> even load it before hitting the heap limit on Allegro 7.0 Trial. The 
> pruning pass was supposed to circumvent this limitation, by pruning 
> the XML tree before conversion to IR (when memory usage really blows 
> up), but the pruning pass doesn't even get to run before VZN runs out 
> of memory. Well, so much for that theory. In any case, if anybody is 
> attempting to run a header that includes windows.h, I'd appreciate it 
> if they could tell me whether it works or not. For OpenGL 
> specifically, if including windows.h doesn't work, then just 
> #define'ing APIENTRY WINGDIAPI and CALLBACK as empty space should get 
> the OpenGL binding generated. You can even do this without modifying 
> the header files, by adding "-DAPIENTRY -DWINGDIAPI -DCALLBACK" to the 
> 'flags' field of the input file.

I am not having success with this. Best I can do is edit the vzntemp.cpp 
to include actual #defines in the .cpp. Turns out freeglut.h itself 
includes the windows.h file (yes, I am extending the example by pulling 
in a GLUT as well). But that is after the GL.h and I get errors on the 
GL.h. Maybe vc++ makes two passes?! Anyway, command-line defines do not 
seem to have effect. I almost think vc++ is throwing in #defines of its 
own in some useful (ha!) way.

So the moral of the story may be that you can run but not hide from 
windows.h <g>. In which case it would be great if Vzn could do the 
pruning by seeing which symbols were declared in desired headers vs all 
headers required. (If that approach will even work!)

I think I will go back to my first success (which included windows.h) 
and see if ACL will accept the resulting (400+kb) library dot lisp.

kt






More information about the fetter-devel mailing list