chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Ported opengl egg to windows


From: Ashley Bone
Subject: [Chicken-users] Ported opengl egg to windows
Date: Fri, 12 Aug 2005 14:10:07 -0500
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050716)

Hi,

For those who are interested, I have ported the OpenGL egg to
windows/MSVC.  The port uses the glprocs package from Intel/SGI
to access OpenGL 1.2+ functions that aren't supported by the
the stock windows library.  If your underlying graphics driver does
not provide a particular function, it will assert if you call it.  I think
most vendors support GL 1.2 and 1.3 - my 3-year old ATI mobility
had all the functions in gl.scm.

MS only provides GLU 1.2, so the this port doesn't provide GLU 1.3
functions.

The egg built with no problems on our two windows machines.  I
was able to run our test program and gears.scm with no trouble.  I
also built the modified egg on my gentoo linux box with no problems.
Unfortunately, I don't have a mac to try it on.

You can get the modified egg at:

http://www.tripolar-games.com/scheme/opengl/

There is also a readme file in that directory explaining all the
changes I made in excessive detail.  Briefly, I:

- Added glprocs.c and the glprocs header files (the license allows
this without restriction).
- opengl.setup:
  Added a windows/msvc build clause.
- gl.scm:
  Added a cond-expand expression to pull in the gl.h and glprocs.h.
  gl.h is necessary so that the correct calling convention is used.
- glu.scm:
  Added a cond-expand expression to pull in windows.h/glu.h.
  Moved the eight functions from GLU 1.3 into a cond-expand expression
  since windows only provides GLU 1.2.
  Wrote separate code to handle the tesselator, quadric and nurbs
  callbacks with MSVC.  I had problems with pointers to __stdcall
  functions.  I couldn't figure out how to declare them as parameters
  in the Easy FFI without choking the parser.  Using foreign-safe-lambda
  w/ (function void () "__stdcall") gets me to C code, but the MS compiler
  doesn't like the way the function pointers are declared.  See the
  readme for more details.

The only change I made that could affect builds on other platforms was the
inclusion of GL/gl.h in gl.scm and GL/glu.h in glu.scm. Since I had to include those files on windows, I changed the opening of the Easy FFI section to #>? from #>!, and I couldn't figure out a way only do that on a particular platform.
The alternative is to create a separate file for windows, I suppose.

thanks,

ashley




reply via email to

[Prev in Thread] Current Thread [Next in Thread]