summaryrefslogtreecommitdiff
path: root/src/glut
diff options
context:
space:
mode:
Diffstat (limited to 'src/glut')
-rw-r--r--src/glut/beos/Makefile3
-rw-r--r--src/glut/directfb/Makefile2
-rw-r--r--src/glut/fbdev/Makefile10
-rw-r--r--src/glut/ggi/Makefile2
-rw-r--r--src/glut/glx/Makefile23
-rw-r--r--src/glut/glx/Makefile.mgw191
-rw-r--r--src/glut/glx/glut.pc.in11
-rw-r--r--src/glut/glx/glut_dstr.c1
-rw-r--r--src/glut/glx/glut_event.c8
-rw-r--r--src/glut/glx/glut_fbc.c4
-rw-r--r--src/glut/glx/glut_fcb.c164
-rw-r--r--src/glut/glx/glutint.h3
-rw-r--r--src/glut/glx/win32_winproc.c3
-rw-r--r--src/glut/mini/Makefile2
14 files changed, 408 insertions, 19 deletions
diff --git a/src/glut/beos/Makefile b/src/glut/beos/Makefile
index 3ff928bfd7..165f43a6ce 100644
--- a/src/glut/beos/Makefile
+++ b/src/glut/beos/Makefile
@@ -83,7 +83,8 @@ $(TOP)/$(LIB_DIR):
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
- @$(TOP)/bin/mklib -o $(GLUT_LIB) -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
+ @$(TOP)/bin/mklib -o $(GLUT_LIB) -ldflags '$(LDFLAGS)' \
+ -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(GLUT_LIB_DEPS) \
$(OBJECTS)
diff --git a/src/glut/directfb/Makefile b/src/glut/directfb/Makefile
index 3791b16df8..aa77db91c6 100644
--- a/src/glut/directfb/Makefile
+++ b/src/glut/directfb/Makefile
@@ -61,7 +61,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
- $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \
+ $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
$(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \
$(MKLIB_OPTIONS) $(OBJECTS)
diff --git a/src/glut/fbdev/Makefile b/src/glut/fbdev/Makefile
index 254ff8c098..948be0c7ba 100644
--- a/src/glut/fbdev/Makefile
+++ b/src/glut/fbdev/Makefile
@@ -63,16 +63,16 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
- $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \
+ $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
$(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \
$(MKLIB_OPTIONS) $(OBJECTS)
install:
- $(INSTALL) -d $(INSTALL_DIR)/include/GL
- $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR)
- $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(INSTALL_DIR)/include/GL
- $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(INSTALL_DIR)/$(LIB_DIR)
+ $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
+ $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+ $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL
+ $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
# Run 'make -f Makefile.solo dep' to update the dependencies if you change
# what's included by any source file.
diff --git a/src/glut/ggi/Makefile b/src/glut/ggi/Makefile
index 1bef6c23a3..c8805c27c0 100644
--- a/src/glut/ggi/Makefile
+++ b/src/glut/ggi/Makefile
@@ -32,7 +32,7 @@ default: $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
- $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \
+ $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) \
-patch $(GLUT_TINY) $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
$(GLUT_LIB_DEPS) $(OBJECTS)
diff --git a/src/glut/glx/Makefile b/src/glut/glx/Makefile
index 7e1d56b327..9f995667b4 100644
--- a/src/glut/glx/Makefile
+++ b/src/glut/glx/Makefile
@@ -36,6 +36,7 @@ SOURCES = \
glut_dstr.c \
glut_event.c \
glut_ext.c \
+ glut_fcb.c \
glut_fullscrn.c \
glut_gamemode.c \
glut_get.c \
@@ -90,17 +91,27 @@ default: $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
- $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \
+ $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
$(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
$(GLUT_LIB_DEPS) $(OBJECTS)
-install:
- $(INSTALL) -d $(INSTALL_DIR)/include/GL
- $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR)
- $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(INSTALL_DIR)/include/GL
- $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(INSTALL_DIR)/$(LIB_DIR)
+# glut pkgconfig file
+pcedit = sed \
+ -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
+ -e 's,@LIB_DIR@,$(LIB_DIR),' \
+ -e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),'
+glut.pc: glut.pc.in
+ $(pcedit) $< > $@
+
+install: glut.pc
+ $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
+ $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+ $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
+ $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL
+ $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+ $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
clean:
diff --git a/src/glut/glx/Makefile.mgw b/src/glut/glx/Makefile.mgw
new file mode 100644
index 0000000000..9fff2e1503
--- /dev/null
+++ b/src/glut/glx/Makefile.mgw
@@ -0,0 +1,191 @@
+# Mesa 3-D graphics library
+# Version: 5.1
+#
+# Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+# MinGW core makefile v1.4 for Mesa
+#
+# Copyright (C) 2002 - Daniel Borca
+# Email : dborca@users.sourceforge.net
+# Web : http://www.geocities.com/dborca
+
+# MinGW core-glut makefile updated for Mesa 7.0
+#
+# Updated : by Heromyth, on 2007-7-21
+# Email : zxpmyth@yahoo.com.cn
+# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
+# The others havn't been tested yet.
+# 2) The generated DLLs are *not* compatible with the ones built
+# with the other compilers like VC8, especially for GLUT.
+# 3) Although more tests are needed, it can be used individually!
+
+
+#
+# Available options:
+#
+# Environment variables:
+# CFLAGS
+#
+# GLIDE path to Glide3 SDK; used with FX.
+# default = $(TOP)/glide3
+# FX=1 build for 3dfx Glide3. Note that this disables
+# compilation of most WMesa code and requires fxMesa.
+# As a consequence, you'll need the Win32 Glide3
+# library to build any application.
+# default = no
+# ICD=1 build the installable client driver interface
+# (windows opengl driver interface)
+# default = no
+# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
+# default = no
+#
+# Targets:
+# all: build GL
+# clean: remove object files
+#
+
+
+
+.PHONY: all clean
+.INTERMEDIATE: x86/gen_matypes.exe
+.SUFFIXES: .rc .res
+
+# Set this to the prefix of your build tools, i.e. mingw32-
+TOOLS_PREFIX = mingw32-
+
+TOP = ../../..
+
+LIBDIR = $(TOP)/lib
+
+LIB_NAME = glut32
+
+DLL_EXT = .dll
+IMP_EXT = .a
+LIB_PRE = lib
+STRIP = -s
+
+AR = ar
+ARFLAGS = crus
+DLLTOOL = dlltool
+
+GLUT_DLL = $(LIB_NAME)$(DLL_EXT)
+GLUT_IMP = $(LIB_PRE)$(LIB_NAME)$(IMP_EXT)
+GLUT_DEF = $(LIB_NAME).def
+
+LDLIBS = -L$(LIBDIR) -lwinmm -lgdi32 -luser32 -lopengl32 -lglu32
+LDFLAGS = $(STRIP) -shared -fPIC -Wl,--kill-at
+
+CFLAGS += -DBUILD_GLUT32 -DGLUT_BUILDING_LIB -DMESA -D_DLL
+CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include
+
+CC = $(TOOLS_PREFIX)gcc
+CXX = $(TOOLS_PREFIX)g++
+CXXFLAGS = $(CFLAGS)
+
+AR = ar
+ARFLAGS = crus
+
+UNLINK = del $(subst /,\,$(1))
+ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
+UNLINK = $(RM) $(1)
+endif
+ifneq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
+UNLINK = $(RM) $(1)
+endif
+
+HDRS = glutint.h glutstroke.h glutbitmap.h glutwin32.h stroke.h win32_glx.h win32_x11.h
+
+SRCS = \
+ glut_bitmap.c \
+ glut_bwidth.c \
+ glut_cindex.c \
+ glut_cmap.c \
+ glut_cursor.c \
+ glut_dials.c \
+ glut_dstr.c \
+ glut_event.c \
+ glut_ext.c \
+ glut_fbc.c \
+ glut_fullscrn.c \
+ glut_gamemode.c \
+ glut_get.c \
+ glut_init.c \
+ glut_input.c \
+ glut_joy.c \
+ glut_key.c \
+ glut_keyctrl.c \
+ glut_keyup.c \
+ glut_mesa.c \
+ glut_modifier.c \
+ glut_overlay.c \
+ glut_shapes.c \
+ glut_space.c \
+ glut_stroke.c \
+ glut_swap.c \
+ glut_swidth.c \
+ glut_tablet.c \
+ glut_teapot.c \
+ glut_util.c \
+ glut_vidresize.c \
+ glut_warp.c \
+ glut_win.c \
+ glut_winmisc.c \
+ win32_glx.c \
+ win32_menu.c \
+ win32_util.c \
+ win32_winproc.c \
+ win32_x11.c
+
+
+SRCSSEMIGENS = \
+ glut_8x13.c \
+ glut_9x15.c \
+ glut_hel10.c \
+ glut_hel12.c \
+ glut_hel18.c \
+ glut_mroman.c \
+ glut_roman.c \
+ glut_tr10.c \
+ glut_tr24.c
+
+
+
+SOURCES = $(SRCS) $(SRCSSEMIGENS)
+
+OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
+
+.c.o:
+ $(CC) -o $@ $(CFLAGS) -c $<
+.cc.o:
+ $(CXX) -o $@ $(CXXFLAGS) -c $<
+
+
+all: $(LIBDIR) $(LIBDIR)/$(GLUT_DLL) $(LIBDIR)/$(GLUT_IMP)
+
+$(LIBDIR):
+ mkdir -p $(LIBDIR)
+
+$(LIBDIR)/$(GLUT_DLL) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
+ $(CXX) $(LDFLAGS) -o $(LIBDIR)/$(GLUT_DLL) $^ $(LDLIBS)
+ $(DLLTOOL) --as=as --dllname $(LIB_NAME) --output-def $(LIBDIR)/$(GLUT_DEF) $^
+ $(DLLTOOL) --as=as -k --dllname $(LIB_NAME) --output-lib $(LIBDIR)/$(GLUT_IMP) --def $(LIBDIR)/$(GLUT_DEF)
+
+clean:
+ -$(call UNLINK,*.o) \ No newline at end of file
diff --git a/src/glut/glx/glut.pc.in b/src/glut/glx/glut.pc.in
new file mode 100644
index 0000000000..f732f2990d
--- /dev/null
+++ b/src/glut/glx/glut.pc.in
@@ -0,0 +1,11 @@
+prefix=@INSTALL_DIR@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/@LIB_DIR@
+includedir=${prefix}/include
+
+Name: glut
+Description: Mesa OpenGL Utility Toolkit library
+Requires: gl glu
+Version: @VERSION@
+Libs: -L${libdir} -lglut
+Cflags: -I${includedir}
diff --git a/src/glut/glx/glut_dstr.c b/src/glut/glx/glut_dstr.c
index ec9386f3e5..2513af4539 100644
--- a/src/glut/glx/glut_dstr.c
+++ b/src/glut/glx/glut_dstr.c
@@ -291,6 +291,7 @@ loadVisuals(int *nitems_return)
fbmodes = (FrameBufferMode *) malloc(n * sizeof(FrameBufferMode));
if (fbmodes == NULL) {
*nitems_return = -1;
+ free(vlist);
return NULL;
}
for (i = 0; i < n; i++) {
diff --git a/src/glut/glx/glut_event.c b/src/glut/glx/glut_event.c
index 4e67da674e..b5df7b2311 100644
--- a/src/glut/glx/glut_event.c
+++ b/src/glut/glx/glut_event.c
@@ -24,7 +24,7 @@
# ifdef __sgi
# include <bstring.h> /* prototype for bzero used by FD_ZERO */
# endif
-# if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE)
+# if (defined(__FreeBSD__) || defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE)
# include <sys/select.h> /* select system call interface */
# ifdef luna
# include <sysent.h>
@@ -172,10 +172,14 @@ handleTimeouts(void)
GETTIMEOFDAY(&now);
while (IS_AT_OR_AFTER(__glutTimerList->timeout, now)) {
timer = __glutTimerList;
- __glutTimerList = timer->next;
+ /* call the timer function */
timer->func(timer->value);
+ /* remove from the linked list */
+ __glutTimerList = timer->next;
+ /* put this timer on the "free" list */
timer->next = freeTimerList;
freeTimerList = timer;
+
if (!__glutTimerList)
break;
}
diff --git a/src/glut/glx/glut_fbc.c b/src/glut/glx/glut_fbc.c
index deb46c3d8d..e93188b862 100644
--- a/src/glut/glx/glut_fbc.c
+++ b/src/glut/glx/glut_fbc.c
@@ -18,7 +18,7 @@
/* Set a Fortran callback function. */
-void GLUTAPIENTRY
+void APIENTRY
__glutSetFCB(int which, void *func)
{
#ifdef SUPPORT_FORTRAN
@@ -100,7 +100,7 @@ __glutSetFCB(int which, void *func)
/* Get a Fortran callback function. */
-void* GLUTAPIENTRY
+void* APIENTRY
__glutGetFCB(int which)
{
#ifdef SUPPORT_FORTRAN
diff --git a/src/glut/glx/glut_fcb.c b/src/glut/glx/glut_fcb.c
new file mode 100644
index 0000000000..c8a3422b36
--- /dev/null
+++ b/src/glut/glx/glut_fcb.c
@@ -0,0 +1,164 @@
+
+/* Copyright (c) Mark J. Kilgard, 1998. */
+
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
+ implied. This program is -not- in the public domain. */
+
+/* I appreciate the guidance from William Mitchell
+ (mitchell@cam.nist.gov) in developing this friend interface
+ for use by the f90gl package. See ../../README.fortran */
+
+#include "glutint.h"
+
+/* FCB stands for Fortran CallBack. */
+
+/* There is only one idleFunc, menuStateFunc, and menuStatusFunc, so they
+ can be saved in the wrappers for Fortran rather than the C structures. */
+
+/* Set a Fortran callback function. */
+
+void APIENTRY
+__glutSetFCB(int which, GLUTproc func)
+{
+#ifdef SUPPORT_FORTRAN
+ switch (which) {
+ case GLUT_FCB_DISPLAY:
+ __glutCurrentWindow->fdisplay = (GLUTdisplayFCB) func;
+ break;
+ case GLUT_FCB_RESHAPE:
+ __glutCurrentWindow->freshape = (GLUTreshapeFCB) func;
+ break;
+ case GLUT_FCB_MOUSE:
+ __glutCurrentWindow->fmouse = (GLUTmouseFCB) func;
+ break;
+ case GLUT_FCB_MOTION:
+ __glutCurrentWindow->fmotion = (GLUTmotionFCB) func;
+ break;
+ case GLUT_FCB_PASSIVE:
+ __glutCurrentWindow->fpassive = (GLUTpassiveFCB) func;
+ break;
+ case GLUT_FCB_ENTRY:
+ __glutCurrentWindow->fentry = (GLUTentryFCB) func;
+ break;
+ case GLUT_FCB_KEYBOARD:
+ __glutCurrentWindow->fkeyboard = (GLUTkeyboardFCB) func;
+ break;
+ case GLUT_FCB_KEYBOARD_UP:
+ __glutCurrentWindow->fkeyboardUp = (GLUTkeyboardFCB) func;
+ break;
+ case GLUT_FCB_WINDOW_STATUS:
+ __glutCurrentWindow->fwindowStatus = (GLUTwindowStatusFCB) func;
+ break;
+ case GLUT_FCB_VISIBILITY:
+ __glutCurrentWindow->fvisibility = (GLUTvisibilityFCB) func;
+ break;
+ case GLUT_FCB_SPECIAL:
+ __glutCurrentWindow->fspecial = (GLUTspecialFCB) func;
+ break;
+ case GLUT_FCB_SPECIAL_UP:
+ __glutCurrentWindow->fspecialUp = (GLUTspecialFCB) func;
+ break;
+ case GLUT_FCB_BUTTON_BOX:
+ __glutCurrentWindow->fbuttonBox = (GLUTbuttonBoxFCB) func;
+ break;
+ case GLUT_FCB_DIALS:
+ __glutCurrentWindow->fdials = (GLUTdialsFCB) func;
+ break;
+ case GLUT_FCB_SPACE_MOTION:
+ __glutCurrentWindow->fspaceMotion = (GLUTspaceMotionFCB) func;
+ break;
+ case GLUT_FCB_SPACE_ROTATE:
+ __glutCurrentWindow->fspaceRotate = (GLUTspaceRotateFCB) func;
+ break;
+ case GLUT_FCB_SPACE_BUTTON:
+ __glutCurrentWindow->fspaceButton = (GLUTspaceButtonFCB) func;
+ break;
+ case GLUT_FCB_TABLET_MOTION:
+ __glutCurrentWindow->ftabletMotion = (GLUTtabletMotionFCB) func;
+ break;
+ case GLUT_FCB_TABLET_BUTTON:
+ __glutCurrentWindow->ftabletButton = (GLUTtabletButtonFCB) func;
+ break;
+#ifdef _WIN32
+ case GLUT_FCB_JOYSTICK:
+ __glutCurrentWindow->fjoystick = (GLUTjoystickFCB) func;
+ break;
+#endif
+ case GLUT_FCB_OVERLAY_DISPLAY:
+ __glutCurrentWindow->overlay->fdisplay = (GLUTdisplayFCB) func;
+ break;
+ case GLUT_FCB_SELECT:
+ __glutCurrentMenu->fselect = (GLUTselectFCB) func;
+ break;
+ case GLUT_FCB_TIMER:
+ __glutNewTimer->ffunc = (GLUTtimerFCB) func;
+ break;
+ }
+#endif
+}
+
+/* Get a Fortran callback function. */
+
+GLUTproc APIENTRY
+__glutGetFCB(int which)
+{
+#ifdef SUPPORT_FORTRAN
+ switch (which) {
+ case GLUT_FCB_DISPLAY:
+ return __glutCurrentWindow->fdisplay;
+ case GLUT_FCB_RESHAPE:
+ return __glutCurrentWindow->freshape;
+ case GLUT_FCB_MOUSE:
+ return __glutCurrentWindow->fmouse;
+ case GLUT_FCB_MOTION:
+ return __glutCurrentWindow->fmotion;
+ case GLUT_FCB_PASSIVE:
+ return __glutCurrentWindow->fpassive;
+ case GLUT_FCB_ENTRY:
+ return __glutCurrentWindow->fentry;
+ case GLUT_FCB_KEYBOARD:
+ return __glutCurrentWindow->fkeyboard;
+ case GLUT_FCB_KEYBOARD_UP:
+ return __glutCurrentWindow->fkeyboardUp;
+ case GLUT_FCB_WINDOW_STATUS:
+ return __glutCurrentWindow->fwindowStatus;
+ case GLUT_FCB_VISIBILITY:
+ return __glutCurrentWindow->fvisibility;
+ case GLUT_FCB_SPECIAL:
+ return __glutCurrentWindow->fspecial;
+ case GLUT_FCB_SPECIAL_UP:
+ return __glutCurrentWindow->fspecialUp;
+ case GLUT_FCB_BUTTON_BOX:
+ return __glutCurrentWindow->fbuttonBox;
+ case GLUT_FCB_DIALS:
+ return __glutCurrentWindow->fdials;
+ case GLUT_FCB_SPACE_MOTION:
+ return __glutCurrentWindow->fspaceMotion;
+ case GLUT_FCB_SPACE_ROTATE:
+ return __glutCurrentWindow->fspaceRotate;
+ case GLUT_FCB_SPACE_BUTTON:
+ return __glutCurrentWindow->fspaceButton;
+ case GLUT_FCB_TABLET_MOTION:
+ return __glutCurrentWindow->ftabletMotion;
+ case GLUT_FCB_TABLET_BUTTON:
+ return __glutCurrentWindow->ftabletButton;
+ case GLUT_FCB_JOYSTICK:
+#ifdef _WIN32
+ return __glutCurrentWindow->fjoystick;
+#else
+ return NULL;
+#endif
+ case GLUT_FCB_OVERLAY_DISPLAY:
+ return __glutCurrentWindow->overlay->fdisplay;
+ case GLUT_FCB_SELECT:
+ return __glutCurrentMenu->fselect;
+ case GLUT_FCB_TIMER:
+ return __glutTimerList ? __glutTimerList->ffunc : NULL;
+ default:
+ return NULL;
+ }
+#else
+ return NULL;
+#endif
+}
diff --git a/src/glut/glx/glutint.h b/src/glut/glx/glutint.h
index 6fe09ffe7e..a962c78023 100644
--- a/src/glut/glx/glutint.h
+++ b/src/glut/glx/glutint.h
@@ -26,7 +26,10 @@
#include <GL/glx.h>
#endif
+#ifndef GLUT_BUILDING_LIB
#define GLUT_BUILDING_LIB /* Building the GLUT library itself. */
+#endif
+
#include <GL/glut.h>
#if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__)
diff --git a/src/glut/glx/win32_winproc.c b/src/glut/glx/win32_winproc.c
index a54bac75fa..e1fc785ebb 100644
--- a/src/glut/glx/win32_winproc.c
+++ b/src/glut/glx/win32_winproc.c
@@ -9,6 +9,9 @@
#include "glutint.h"
#include <sys/timeb.h>
+#ifdef __MINGW32__
+#include <ctype.h>
+#endif
#if defined(_WIN32) && !defined(__CYGWIN32__)
#include <mmsystem.h> /* Win32 Multimedia API header. */
diff --git a/src/glut/mini/Makefile b/src/glut/mini/Makefile
index 177bfe2d2b..87ff43ce56 100644
--- a/src/glut/mini/Makefile
+++ b/src/glut/mini/Makefile
@@ -55,7 +55,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
- $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \
+ $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
$(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \
$(MKLIB_OPTIONS) $(OBJECTS)