Added glut*WithExit functions. Now glut32.dll is fully implemented. by Jacek Caban, jack@xxxxxxxxxxxxxxxx --- dlls/glut32/glut.c 2003-12-15 21:13:48.000000000 +0100 +++ dlls/glut32/glut.c 2003-12-15 21:12:57.000000000 +0100 @@ -16,8 +16,17 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <stdlib.h> #include "windef.h" +static void (*__glutExitFunc)(int ret) = 0; + +static void __glutOnExit(int ret, void *arg) +{ + if(__glutExitFunc) + __glutExitFunc(ret); +} + /**************************************************** * glutGetColor (glut32.@) */ @@ -57,8 +66,9 @@ /**************************************************** * __glutCreateMenuWithExit (glut32.@) */ -int WINAPI wine___glutCreateMenuWithExit(void *arg1, void *arg2) +int WINAPI wine___glutCreateMenuWithExit(void *arg1, void (*exitfunc)(int)) { + __glutExitFunc = exitfunc; return glutCreateMenu(arg1); } @@ -83,8 +93,9 @@ /**************************************************** * __glutCreateWindowWithExit (glut32.@) */ -int WINAPI wine___glutCreateWindowWithExit(void *arg, void *arg2) +int WINAPI wine___glutCreateWindowWithExit(void *arg, void (*exitfunc)(int)) { + __glutExitFunc = exitfunc; return glutCreateWindow(arg); } @@ -433,8 +444,9 @@ /********************************************** * __glutInitWithExit (glut32.@) */ -void WINAPI wine___glutInitWithExit(void *arg1, void *arg2, void *arg3) +void WINAPI wine___glutInitWithExit(void *arg1, void *arg2, void (*exitfunc)(int)) { + __glutExitFunc = exitfunc; glutInit(arg1, arg2); } @@ -498,6 +510,7 @@ extern void glutMainLoop(void); void WINAPI wine_glutMainLoop(void) { + on_exit(__glutOnExit, 0); glutMainLoop(); }