Squashed commit of the following:

commit 1856230d9fa61710cce3e152b8d88b1269611a73
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Tue Jul 12 23:41:27 2011 +0100

    make: Use better var names on packaging.

commit d1ae72d0bd14e820ecfe9f8f27b316f9566ceb0c
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Tue Jul 12 23:38:21 2011 +0100

    make: Apply several of Dan Nicholson's suggestions.

commit f27cf8743ac9cbf4c0ad66aff0cd3f97efde97e4
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 14:18:20 2011 +0100

    make: Put back the tar.bz2 creation rule.

    Removed by accident.

commit 34983337f9d7db984e9f0117808274106d262110
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 11:59:29 2011 +0100

    make: Determine tarballs contents via git ls-files.

    The wildcards were a mess:
    - lots of files for non Linux platforms missing
    - several files listed and archived twice

    Using git-ls-files ensures things are not loss when making the tarballs.

commit 34a28ccbf459ed5710aafba5e7149e8291cb808c
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 11:07:14 2011 +0100

    glut: Remove GLUT source.

    Most distros ship freeglut, and most people don't care one vs the other,
    and it hasn't been really maintained.

    So it is better to have Mesa GLUT be revisioned and built separately
    from Mesa.

commit 5c26a2c3c0c7e95ef853e19d12d75c4f80137e7d
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 10:31:02 2011 +0100

    Ignore the tarballs.

commit 26edecac589819f0d0efe2165ab748dbc4e53394
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 10:30:24 2011 +0100

    make: Create the Mesa-xxx-devel symlink automatically.

    Also actually remote the intermediate uncompressed tarballs.
This commit is contained in:
José Fonseca 2011-07-14 17:28:52 +01:00
parent ff2efdf599
commit 9a7f84d6b2
181 changed files with 71 additions and 63354 deletions

5
.gitignore vendored
View File

@ -11,6 +11,10 @@
*.pyo
*.so
*.sw[a-z]
*.tar
*.tar.bz2
*.tar.gz
*.zip
*~
depend
depend.bak
@ -25,4 +29,5 @@ cscope*
.scon*
config.py
build
manifest.txt
.dir-locals.el

357
Makefile
View File

@ -183,280 +183,31 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.12-devel
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION)
PACKAGE_VERSION=7.12-devel
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
# This is part of MAIN_FILES
MAIN_ES_FILES = \
$(DIRECTORY)/src/mesa/main/*.xml \
$(DIRECTORY)/src/mesa/main/*.py \
$(DIRECTORY)/src/mesa/main/*.dtd
EXTRA_FILES = \
aclocal.m4 \
configure \
src/glsl/glsl_parser.cpp \
src/glsl/glsl_parser.h \
src/glsl/glsl_lexer.cpp \
src/glsl/glcpp/glcpp-lex.c \
src/glsl/glcpp/glcpp-parse.c \
src/glsl/glcpp/glcpp-parse.h \
src/mesa/program/lex.yy.c \
src/mesa/program/program_parse.tab.c \
src/mesa/program/program_parse.tab.h
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
$(DIRECTORY)/configure \
$(DIRECTORY)/configure.ac \
$(DIRECTORY)/acinclude.m4 \
$(DIRECTORY)/aclocal.m4 \
$(DIRECTORY)/SConstruct \
$(DIRECTORY)/common.py \
$(DIRECTORY)/scons/*py \
$(DIRECTORY)/bin/config.guess \
$(DIRECTORY)/bin/config.sub \
$(DIRECTORY)/bin/extract_git_sha1 \
$(DIRECTORY)/bin/install-sh \
$(DIRECTORY)/bin/mklib \
$(DIRECTORY)/bin/minstall \
$(DIRECTORY)/bin/version.mk \
$(DIRECTORY)/configs/[a-z]* \
$(DIRECTORY)/docs/*.html \
$(DIRECTORY)/docs/COPYING \
$(DIRECTORY)/docs/README.* \
$(DIRECTORY)/docs/RELNOTES* \
$(DIRECTORY)/docs/*.spec \
$(DIRECTORY)/include/GL/gl.h \
$(DIRECTORY)/include/GL/glext.h \
$(DIRECTORY)/include/GL/gl_mangle.h \
$(DIRECTORY)/include/GL/glu.h \
$(DIRECTORY)/include/GL/glu_mangle.h \
$(DIRECTORY)/include/GL/glx.h \
$(DIRECTORY)/include/GL/glxext.h \
$(DIRECTORY)/include/GL/glx_mangle.h \
$(DIRECTORY)/include/GL/glfbdev.h \
$(DIRECTORY)/include/GL/mesa_wgl.h \
$(DIRECTORY)/include/GL/osmesa.h \
$(DIRECTORY)/include/GL/vms_x_fix.h \
$(DIRECTORY)/include/GL/wglext.h \
$(DIRECTORY)/include/GL/wmesa.h \
$(DIRECTORY)/include/pci_ids/*.h \
$(DIRECTORY)/include/c99/*.h \
$(DIRECTORY)/src/getopt/SConscript \
$(DIRECTORY)/src/getopt/getopt*.[ch] \
$(DIRECTORY)/src/glsl/Makefile \
$(DIRECTORY)/src/glsl/Makefile.template \
$(DIRECTORY)/src/glsl/SConscript \
$(DIRECTORY)/src/glsl/*.[ch] \
$(DIRECTORY)/src/glsl/*.ll \
$(DIRECTORY)/src/glsl/*.yy \
$(DIRECTORY)/src/glsl/*.[cly]pp \
$(DIRECTORY)/src/glsl/README \
$(DIRECTORY)/src/glsl/glcpp/*.[chly] \
$(DIRECTORY)/src/glsl/glcpp/README \
$(DIRECTORY)/src/glsl/builtins \
$(DIRECTORY)/src/Makefile \
$(DIRECTORY)/src/SConscript \
$(DIRECTORY)/src/mesa/Makefile* \
$(DIRECTORY)/src/mesa/SConscript \
$(DIRECTORY)/src/mesa/sources.mak \
$(DIRECTORY)/src/mesa/descrip.mms \
$(DIRECTORY)/src/mesa/gl.pc.in \
$(DIRECTORY)/src/mesa/osmesa.pc.in \
$(DIRECTORY)/src/mesa/depend \
$(MAIN_ES_FILES) \
$(DIRECTORY)/src/mesa/main/*.[chS] \
$(DIRECTORY)/src/mesa/main/*.cpp \
$(DIRECTORY)/src/mesa/main/descrip.mms \
$(DIRECTORY)/src/mesa/math/*.[ch] \
$(DIRECTORY)/src/mesa/math/descrip.mms \
$(DIRECTORY)/src/mesa/program/*.[chly] \
$(DIRECTORY)/src/mesa/program/*.cpp \
$(DIRECTORY)/src/mesa/program/descrip.mms \
$(DIRECTORY)/src/mesa/swrast/*.[ch] \
$(DIRECTORY)/src/mesa/swrast/descrip.mms \
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
$(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \
$(DIRECTORY)/src/mesa/vbo/*.[chS] \
$(DIRECTORY)/src/mesa/vbo/descrip.mms \
$(DIRECTORY)/src/mesa/tnl/*.[chS] \
$(DIRECTORY)/src/mesa/tnl/descrip.mms \
$(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \
$(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \
$(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \
$(DIRECTORY)/src/mesa/drivers/Makefile \
$(DIRECTORY)/src/mesa/drivers/beos/*.cpp \
$(DIRECTORY)/src/mesa/drivers/beos/Makefile \
$(DIRECTORY)/src/mesa/drivers/common/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/common/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/fbdev/Makefile \
$(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \
$(DIRECTORY)/src/mesa/drivers/osmesa/Makefile \
$(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win \
$(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \
$(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/SConscript \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
$(DIRECTORY)/src/mesa/drivers/x11/Makefile \
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
$(DIRECTORY)/src/mesa/ppc/*.[ch] \
$(DIRECTORY)/src/mesa/sparc/*.[chS] \
$(DIRECTORY)/src/mesa/x86/Makefile \
$(DIRECTORY)/src/mesa/x86/*.[ch] \
$(DIRECTORY)/src/mesa/x86/*.S \
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
$(DIRECTORY)/src/mesa/x86-64/Makefile
MAPI_FILES = \
$(DIRECTORY)/include/GLES/*.h \
$(DIRECTORY)/include/GLES2/*.h \
$(DIRECTORY)/include/VG/*.h \
$(DIRECTORY)/src/mapi/es?api/Makefile \
$(DIRECTORY)/src/mapi/es?api/*.pc.in \
$(DIRECTORY)/src/mapi/glapi/gen/Makefile \
$(DIRECTORY)/src/mapi/glapi/gen/*.xml \
$(DIRECTORY)/src/mapi/glapi/gen/*.py \
$(DIRECTORY)/src/mapi/glapi/gen/*.dtd \
$(DIRECTORY)/src/mapi/glapi/gen-es/Makefile \
$(DIRECTORY)/src/mapi/glapi/gen-es/*.xml \
$(DIRECTORY)/src/mapi/glapi/gen-es/*.py \
$(DIRECTORY)/src/mapi/glapi/Makefile \
$(DIRECTORY)/src/mapi/glapi/SConscript \
$(DIRECTORY)/src/mapi/glapi/sources.mak \
$(DIRECTORY)/src/mapi/glapi/*.[chS] \
$(DIRECTORY)/src/mapi/mapi/mapi_abi.py \
$(DIRECTORY)/src/mapi/mapi/sources.mak \
$(DIRECTORY)/src/mapi/mapi/*.[ch] \
$(DIRECTORY)/src/mapi/shared-glapi/SConscript \
$(DIRECTORY)/src/mapi/shared-glapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/SConscript \
$(DIRECTORY)/src/mapi/vgapi/vgapi.csv \
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in
EGL_FILES = \
$(DIRECTORY)/include/KHR/*.h \
$(DIRECTORY)/include/EGL/*.h \
$(DIRECTORY)/src/egl/Makefile \
$(DIRECTORY)/src/egl/*/Makefile \
$(DIRECTORY)/src/egl/*/Makefile.template \
$(DIRECTORY)/src/egl/*/*.[ch] \
$(DIRECTORY)/src/egl/*/*/Makefile \
$(DIRECTORY)/src/egl/*/*/*.[ch] \
$(DIRECTORY)/src/egl/wayland/wayland-drm/protocol/*.xml \
$(DIRECTORY)/src/egl/wayland/wayland-egl/*.pc.in \
$(DIRECTORY)/src/egl/main/SConscript \
$(DIRECTORY)/src/egl/main/*.pc.in \
$(DIRECTORY)/src/egl/main/*.def
GBM_FILES = \
$(DIRECTORY)/src/gbm/Makefile \
$(DIRECTORY)/src/gbm/main/*.pc.in \
$(DIRECTORY)/src/gbm/main/*.[ch] \
$(DIRECTORY)/src/gbm/main/Makefile \
$(DIRECTORY)/src/gbm/backends/Makefile \
$(DIRECTORY)/src/gbm/backends/Makefile.template \
$(DIRECTORY)/src/gbm/backends/*/*.[ch] \
$(DIRECTORY)/src/gbm/backends/*/Makefile \
GALLIUM_FILES = \
$(DIRECTORY)/src/mesa/state_tracker/*[ch] \
$(DIRECTORY)/src/gallium/Makefile \
$(DIRECTORY)/src/gallium/Makefile.template \
$(DIRECTORY)/src/gallium/SConscript \
$(DIRECTORY)/src/gallium/targets/Makefile.dri \
$(DIRECTORY)/src/gallium/targets/Makefile.xorg \
$(DIRECTORY)/src/gallium/targets/SConscript.dri \
$(DIRECTORY)/src/gallium/*/Makefile \
$(DIRECTORY)/src/gallium/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/auxiliary/gallivm/*.cpp \
$(DIRECTORY)/src/gallium/*/*/*.py \
$(DIRECTORY)/src/gallium/*/*/*.csv \
$(DIRECTORY)/src/gallium/*/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py
APPLE_DRI_FILES = \
$(DIRECTORY)/src/glx/apple/Makefile \
$(DIRECTORY)/src/glx/apple/*.[ch]
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \
$(DIRECTORY)/include/GL/internal/sarea.h \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/*.[ch] \
$(APPLE_DRI_FILES) \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile* \
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.cpp \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
SGI_GLU_FILES = \
$(DIRECTORY)/src/glu/Makefile \
$(DIRECTORY)/src/glu/glu.pc.in \
$(DIRECTORY)/src/glu/sgi/Makefile \
$(DIRECTORY)/src/glu/sgi/Makefile.mgw \
$(DIRECTORY)/src/glu/sgi/Makefile.win \
$(DIRECTORY)/src/glu/sgi/glu.def \
$(DIRECTORY)/src/glu/sgi/dummy.cc \
$(DIRECTORY)/src/glu/sgi/glu.exports \
$(DIRECTORY)/src/glu/sgi/glu.exports.darwin \
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
$(DIRECTORY)/src/glu/sgi/include/gluos.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.cc \
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.cc \
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.cc \
$(DIRECTORY)/src/glu/sgi/libtess/README \
$(DIRECTORY)/src/glu/sgi/libtess/alg-outline \
$(DIRECTORY)/src/glu/sgi/libtess/*.[ch] \
$(DIRECTORY)/src/glu/sgi/libutil/*.[ch]
GLW_FILES = \
$(DIRECTORY)/src/glw/*.[ch] \
$(DIRECTORY)/src/glw/Makefile* \
$(DIRECTORY)/src/glw/README \
$(DIRECTORY)/src/glw/glw.pc.in \
$(DIRECTORY)/src/glw/depend
GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \
$(DIRECTORY)/include/GL/glutf90.h \
$(DIRECTORY)/src/glut/glx/Makefile* \
$(DIRECTORY)/src/glut/glx/SConscript \
$(DIRECTORY)/src/glut/glx/depend \
$(DIRECTORY)/src/glut/glx/glut.pc.in \
$(DIRECTORY)/src/glut/glx/*def \
$(DIRECTORY)/src/glut/glx/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.cpp \
$(DIRECTORY)/src/glut/beos/Makefile
IGNORE_FILES = \
-x autogen.sh
DEPEND_FILES = \
$(TOP)/src/mesa/depend \
$(TOP)/src/glx/depend \
$(TOP)/src/glw/depend \
$(TOP)/src/glut/glx/depend \
$(TOP)/src/glu/sgi/depend
LIB_FILES = \
$(MAIN_FILES) \
$(MAPI_FILES) \
$(ES_FILES) \
$(EGL_FILES) \
$(GBM_FILES) \
$(GALLIUM_FILES) \
$(DRI_FILES) \
$(SGI_GLU_FILES) \
$(GLW_FILES)
src/mesa/depend \
src/glx/depend \
src/glw/depend \
src/glu/sgi/depend
parsers: configure
@ -466,15 +217,12 @@ parsers: configure
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(LIB_NAME).tar.gz \
$(LIB_NAME).tar.bz2 \
$(LIB_NAME).zip \
$(GLUT_NAME).tar.gz \
$(GLUT_NAME).tar.bz2 \
$(GLUT_NAME).zip
ARCHIVES = $(PACKAGE_NAME).tar.gz \
$(PACKAGE_NAME).tar.bz2 \
$(PACKAGE_NAME).zip \
tarballs: md5
rm -f ../$(LIB_NAME).tar
rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
# Helper for autoconf builds
ACLOCAL = aclocal
@ -492,46 +240,33 @@ rm_depend:
touch $$dep ; \
done
rm_config: parsers
rm -f configs/current
rm -f configs/autoconf
manifest.txt: .git
( \
ls -1 $(EXTRA_FILES) ; \
git ls-files $(IGNORE_FILES) \
) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
$(LIB_NAME).tar: rm_config
cd .. ; tar -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
../$(PACKAGE_DIR):
ln -s $(PWD) $@
$(LIB_NAME).tar.gz: $(LIB_NAME).tar
gzip --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.gz
$(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
$(GLUT_NAME).tar: rm_depend
cd .. ; tar -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
$(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
$(GLUT_NAME).tar.gz: $(GLUT_NAME).tar
gzip --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.gz
$(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
$(LIB_NAME).tar.bz2: $(LIB_NAME).tar
bzip2 --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.bz2
$(GLUT_NAME).tar.bz2: $(GLUT_NAME).tar
bzip2 --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.bz2
$(LIB_NAME).zip: rm_config
rm -f $(LIB_NAME).zip ; \
$(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
rm -f $(PACKAGE_NAME).zip ; \
cd .. ; \
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
mv $(LIB_NAME).zip $(DIRECTORY)
$(GLUT_NAME).zip:
rm -f $(GLUT_NAME).zip ; \
cd .. ; \
zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \
mv $(GLUT_NAME).zip $(DIRECTORY)
zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
md5: $(ARCHIVES)
@-md5sum $(LIB_NAME).tar.gz
@-md5sum $(LIB_NAME).tar.bz2
@-md5sum $(LIB_NAME).zip
@-md5sum $(GLUT_NAME).tar.gz
@-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip
@-md5sum $(PACKAGE_NAME).tar.gz
@-md5sum $(PACKAGE_NAME).tar.bz2
@-md5sum $(PACKAGE_NAME).zip
.PHONY: tarballs rm_depend rm_config md5
.PHONY: tarballs rm_depend md5

View File

@ -17,13 +17,11 @@ MKLIB_OPTIONS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -lX11 -lXext -lpthread -lm
GLU_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lm -lC
GLUT_LIB_DEPS = -L$(TOP)/lib -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu -lX11 -lm
GLW_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lXm -lXt -lX11
OSMESA_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB)
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm -lC

View File

@ -15,13 +15,11 @@ LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lC
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu -lX11 -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXm -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/lib64 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lpthread -lC

View File

@ -16,7 +16,6 @@ LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -18,6 +18,5 @@ CXXFLAGS += -fno-strict-aliasing
MKLIB_OPTIONS = -arch aix-gcc
GL_LIB_DEPS = -lX11 -lXext -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -Wl,-brtl -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXmu -lXi

View File

@ -15,7 +15,6 @@ MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -36,7 +36,6 @@ LLVM_CFLAGS = @LLVM_CFLAGS@
LLVM_LDFLAGS = @LLVM_LDFLAGS@
LLVM_LIBS = @LLVM_LIBS@
GLW_CFLAGS = @GLW_CFLAGS@
GLUT_CFLAGS = @GLUT_CFLAGS@
GLX_TLS = @GLX_TLS@
DRI_CFLAGS = @DRI_CFLAGS@
DRI_CXXFLAGS = @DRI_CXXFLAGS@
@ -67,7 +66,6 @@ BISON = @BISON@
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU
GLUT_LIB = glut
GLW_LIB = GLw
OSMESA_LIB = @OSMESA_LIB@
GLESv1_CM_LIB = GLESv1_CM
@ -80,7 +78,6 @@ GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
GLU_LIB_NAME = @GLU_LIB_NAME@
GLUT_LIB_NAME = @GLUT_LIB_NAME@
GLW_LIB_NAME = @GLW_LIB_NAME@
OSMESA_LIB_NAME = @OSMESA_LIB_NAME@
EGL_LIB_NAME = @EGL_LIB_NAME@
@ -94,7 +91,6 @@ GBM_LIB_NAME = @GBM_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
GLU_LIB_GLOB = @GLU_LIB_GLOB@
GLUT_LIB_GLOB = @GLUT_LIB_GLOB@
GLW_LIB_GLOB = @GLW_LIB_GLOB@
OSMESA_LIB_GLOB = @OSMESA_LIB_GLOB@
EGL_LIB_GLOB = @EGL_LIB_GLOB@
@ -142,8 +138,6 @@ OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @EGL_LIB_DEPS@
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLU_LIB_DEPS@
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLUT_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLUT_LIB_DEPS@
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLW_LIB_DEPS@
APP_LIB_DEPS = $(EXTRA_LIB_PATH) @APP_LIB_DEPS@
@ -201,9 +195,6 @@ GLU_PC_REQ = @GLU_PC_REQ@
GLU_PC_REQ_PRIV = @GLU_PC_REQ_PRIV@
GLU_PC_LIB_PRIV = @GLU_PC_LIB_PRIV@
GLU_PC_CFLAGS = @GLU_PC_CFLAGS@
GLUT_PC_REQ_PRIV = @GLUT_PC_REQ_PRIV@
GLUT_PC_LIB_PRIV = @GLUT_PC_LIB_PRIV@
GLUT_PC_CFLAGS = @GLUT_PC_CFLAGS@
GLW_PC_REQ_PRIV = @GLW_PC_REQ_PRIV@
GLW_PC_LIB_PRIV = @GLW_PC_LIB_PRIV@
GLW_PC_CFLAGS = @GLW_PC_CFLAGS@

View File

@ -90,7 +90,7 @@ else
endif
# Directories
SRC_DIRS = gallium mesa glu glut/beos
SRC_DIRS = gallium mesa glu
GLU_DIRS = sgi
DRIVER_DIRS = beos
@ -98,6 +98,5 @@ DRIVER_DIRS = beos
GL_LIB_DEPS =
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS =
GLUT_LIB_DEPS = -lgame -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
APP_LIB_DEPS = -lbe -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLUT_LIB)

View File

@ -33,7 +33,6 @@ CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing -fvisibility=hidden \
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).dylib
GLU_LIB_NAME = lib$(GLU_LIB).dylib
GLUT_LIB_NAME = lib$(GLUT_LIB).dylib
GLW_LIB_NAME = lib$(GLW_LIB).dylib
OSMESA_LIB_NAME = lib$(OSMESA_LIB).dylib
VG_LIB_NAME = lib$(VG_LIB).dylib
@ -41,7 +40,6 @@ VG_LIB_NAME = lib$(VG_LIB).dylib
# globs used to install the lib and all symlinks
GL_LIB_GLOB = lib$(GL_LIB).*dylib
GLU_LIB_GLOB = lib$(GLU_LIB).*dylib
GLUT_LIB_GLOB = lib$(GLUT_LIB).*dylib
GLW_LIB_GLOB = lib$(GLW_LIB).*dylib
OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib
VG_LIB_GLOB = lib$(VG_LIB).*dylib
@ -49,12 +47,11 @@ VG_LIB_GLOB = lib$(VG_LIB).*dylib
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS =
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu glut/glx
SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu
GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri

View File

@ -54,7 +54,6 @@ INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU
GLUT_LIB = glut
GLW_LIB = GLw
OSMESA_LIB = OSMesa
EGL_LIB = EGL
@ -68,7 +67,6 @@ GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).so
GLU_LIB_NAME = lib$(GLU_LIB).so
GLUT_LIB_NAME = lib$(GLUT_LIB).so
GLW_LIB_NAME = lib$(GLW_LIB).so
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
EGL_LIB_NAME = lib$(EGL_LIB).so
@ -82,7 +80,6 @@ GBM_LIB_NAME = lib$(GBM_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
GLU_LIB_GLOB = $(GLU_LIB_NAME)*
GLUT_LIB_GLOB = $(GLUT_LIB_NAME)*
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
EGL_LIB_GLOB = $(EGL_LIB_NAME)*
@ -108,7 +105,7 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2
# Directories to build
LIB_DIR = lib
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium egl gallium/winsys gallium/targets glu glut/glx glw
gallium egl gallium/winsys gallium/targets glu glw
GLU_DIRS = sgi
DRIVER_DIRS = x11 osmesa
@ -137,7 +134,6 @@ GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -ldl -lpthread
OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lm
GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
@ -147,7 +143,7 @@ GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) -ludev -ldl
# Program dependencies - specific GL/glut libraries added in Makefiles
# Program dependencies - specific GL libraries added in Makefiles
APP_LIB_DEPS = -lm
X11_LIBS = -lX11
@ -180,9 +176,6 @@ GLU_PC_REQ = gl
GLU_PC_REQ_PRIV =
GLU_PC_LIB_PRIV =
GLU_PC_CFLAGS =
GLUT_PC_REQ_PRIV =
GLUT_PC_LIB_PRIV =
GLUT_PC_CFLAGS =
GLW_PC_REQ_PRIV =
GLW_PC_LIB_PRIV =
GLW_PC_CFLAGS =

View File

@ -21,7 +21,6 @@ CFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES) -ff
CXXFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES)
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing

View File

@ -38,12 +38,11 @@ DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LI
GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -pthread $(LIBDRM_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGL -lXt -lX11
# Directories
SRC_DIRS = glx gallium mesa glu glut/glx glw
SRC_DIRS = glx gallium mesa glu glw
DRIVER_DIRS = dri
DRM_SOURCE_PATH=$(TOP)/../drm

View File

@ -10,7 +10,6 @@ CXX = g++
CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -ansi -O3 -D_HPUX_SOURCE
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing

View File

@ -16,7 +16,6 @@ MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
@ -24,7 +23,6 @@ OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm -lstdc++
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm -lstdc++

View File

@ -18,7 +18,6 @@ MKLIB_OPTIONS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
@ -26,5 +25,4 @@ OSMESA_LIB_NAME = libOSMesa.a
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB)
GL_LIB_DEPS = -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXt -lXi -lX11 -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(GL_LIB_DEPS)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@ -18,7 +18,6 @@ MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -18,7 +18,6 @@ MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -19,7 +19,6 @@ LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
@ -27,5 +26,4 @@ OSMESA_LIB_NAME = libOSMesa.a
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB)
GL_LIB_DEPS = -L/usr/lib/X11R6/pa20_64 -L/usr/contrib/X11R6/lib/pa20_64 -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(GL_LIB_DEPS)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@ -19,7 +19,6 @@ LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -19,12 +19,10 @@ LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.so
GLU_LIB_NAME = libGLU.so
GLUT_LIB_NAME = libglut.so
GLW_LIB_NAME = libGLw.so
OSMESA_LIB_NAME = libOSMesa.so
# Library/program dependencies
GL_LIB_DEPS = -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(GL_LIB_DEPS)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@ -19,7 +19,6 @@ LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -19,7 +19,6 @@ APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -64 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -l
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -15,11 +15,10 @@ GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -n32 -glut -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm -lC
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -n32 -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm -lC
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -15,11 +15,10 @@ GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -32 -glut -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lC
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -32 -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lC
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -33,6 +33,5 @@ CXXFLAGS = -Wall -Wpointer-arith $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
GLUT_CFLAGS = -fexceptions
EXTRA_LIB_PATH = -L/usr/X11R6/lib

View File

@ -9,14 +9,12 @@ CC = gcc
CXX = g++
CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE -DUSE_XSHM
CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@ -9,7 +9,6 @@ CC = gcc
CXX = g++
CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE -DUSE_XSHM
CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static
PIC_FLAGS =
@ -20,12 +19,10 @@ CXXFLAGS += -fno-strict-aliasing
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -L/usr/X11R6/lib -lX11 -lm

View File

@ -38,7 +38,7 @@ CXXFLAGS = $(COMMON_C_CPP_FLAGS)
# Omitting glw here:
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium gallium/winsys gallium/targets glu glut/glx
gallium gallium/winsys gallium/targets glu
# Build no traditional Mesa drivers:
DRIVER_DIRS =

View File

@ -32,7 +32,6 @@ CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing

View File

@ -49,7 +49,7 @@ DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(L
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB) $(shell pkg-config --libs xcb) $(shell pkg-config --libs x11-xcb) $(shell pkg-config --libs xcb-glx)
SRC_DIRS = glx gallium mesa glu glut/glx glw
SRC_DIRS = glx gallium mesa glu glw
DRIVER_DIRS = dri
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon \

View File

@ -9,10 +9,8 @@ CFLAGS += -DUSE_GLFBDEV_DRIVER
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
SRC_DIRS += glut/fbdev
DRIVER_DIRS = fbdev osmesa
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread
OSMESA_LIB_DEPS = -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lgpm -lm

View File

@ -9,12 +9,10 @@ CC = icc
CXX = icpc
CFLAGS = -O3 -ansi -KPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -ansi -KPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -arch icc-istatic
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB)

View File

@ -9,19 +9,16 @@ CC = icc
CXX = icpc
CFLAGS = -O3 -ansi -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -ansi -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static -arch icc-istatic
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -i-static -cxxlib-icc -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lpthread -lm -lcxa -lunwind

View File

@ -9,11 +9,9 @@ CC = icc
CXX = g++
CFLAGS = -O3 -tpp6 -axK -KPIC -D_GCC_LIMITS_H_ -D__GNUC__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -arch icc
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
MESA_ASM_SOURCES = $(X86_SOURCES)

View File

@ -9,18 +9,15 @@ CC = icc
CXX = icpc
CFLAGS = -O3 -tpp6 -axK -D_GCC_LIMITS_H_ -D__GNUC__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -tpp6 -axK -DPTHREADS
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static -arch icc
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
GLUT_LIB_DEPS =
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -lpthread -lcxa -lunwind
MESA_ASM_SOURCES = $(X86_SOURCES)

View File

@ -48,5 +48,5 @@ GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
# Directories
SRC_DIRS = glx glu glut/glx glw
SRC_DIRS = glx glu glw
DRIVER_DIRS =

View File

@ -17,7 +17,6 @@ MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
@ -30,7 +29,6 @@ DRIVER_DIRS = osmesa
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
$(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm

View File

@ -10,6 +10,5 @@ PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -10,7 +10,6 @@ PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
@ -18,7 +17,6 @@ OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
# Need to specify all libraries we may need

View File

@ -10,7 +10,6 @@ PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
@ -18,7 +17,6 @@ OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
# Need to specify all libraries we may need

View File

@ -10,7 +10,6 @@ PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
@ -18,7 +17,6 @@ OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
# Need to specify all libraries we may need

View File

@ -9,7 +9,6 @@ CC = gcc
CXX = g++
CFLAGS = -O2 -fPIC -DUSE_XSHM -I/usr/X11R6/include -DHZ=100
CXXFLAGS = -O2 -fPIC
GLUT_CFLAGS = -fexceptions
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm
# Work around aliasing bugs - developers should comment this out

View File

@ -17,6 +17,5 @@ CXXFLAGS += -fno-strict-aliasing
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm
OSMESA_LIB_DEPS = -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lm
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@ -12,5 +12,4 @@ CXXFLAGS = -O2 -std ansi -ieee -DPTHREADS -D_REENTRANT
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm

View File

@ -13,5 +13,4 @@ MKLIB_OPTIONS = -static
GL_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
APP_LIB_DEPS = -noso -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -so_archive -lX11 -lXext -lXmu -lXi -lpthread -lm -lcxx

View File

@ -9,10 +9,9 @@ CC = cc
CFLAGS = -Xa -xO3 -xpentium -KPIC -I/usr/openwin/include -DUSE_XSHM
MKLIB_OPTIONS = -static
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm -lglut -lGLU -lGL
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm -lGLU -lGL
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -9,7 +9,6 @@ CC = gcc
CXX = g++
CFLAGS = -O3 -march=i486 -fPIC -I/usr/openwin/include -DUSE_XSHM
CXXFLAGS = -O3 -march=i486 -fPIC
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
@ -17,5 +16,4 @@ CXXFLAGS += -fno-strict-aliasing
GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/openwin/lib -lX11 -lXmu -lXt -lXi -lm
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXi -lXmu

View File

@ -9,7 +9,6 @@ CC = gcc
CXX = g++
CFLAGS = -O3 -march=i486 -fPIC -I/usr/openwin/include -DUSE_XSHM
CXXFLAGS = -O3 -march=i486 -fPIC
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static
# Work around aliasing bugs - developers should comment this out
@ -18,11 +17,9 @@ CXXFLAGS += -fno-strict-aliasing
GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/openwin/lib -lX11 -lXmu -lXt -lXi -lm
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXi -lXmu
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -9,7 +9,6 @@ CC = gcc
CXX = g++
CFLAGS = -fPIC -O3 -I/usr/openwin/include -I/usr/include/X11R5 -I/usr/include/X11R5 -DUSE_XSHM -DSUNOS4
CXXFLAGS = -fPIC -O3 -I/usr/openwin/include -DSUNOS4
GLUT_CFLAGS = -fexceptions -DSOLARIS_2_4_BUG
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing

View File

@ -12,7 +12,6 @@ MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
@ -20,6 +19,5 @@ OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm

View File

@ -9,10 +9,8 @@ CC = cc
CXX = c++
CFLAGS = -KPIC -Xa -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM
CXXFLAGS = -KPIC -Xa -O -I/usr/openwin/include -I/usr/dt/include
GLUT_CFLAGS = -DSOLARIS_2_4_BUG
GL_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -lX11 -lXext -lXmu -lXi -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lCrun -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@ -26,7 +26,6 @@ CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
-I/usr/openwin/include
GLUT_CFLAGS = -fexceptions -DSOLARIS_2_4_BUG
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
@ -36,5 +35,4 @@ CXXFLAGS += -fno-strict-aliasing
EXTRA_LIB_PATH=-L/usr/openwin/lib
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXi -lm
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@ -9,11 +9,9 @@ CC = cc
CXX = c++
CFLAGS = -KPIC -Xa -native -fast -xO5 -xlibmil -xsafe=mem -xdepend -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG
CXXFLAGS = -KPIC -Xa -native -fast -xO5 -xlibmil -xsafe=mem -xdepend -I/usr/openwin/include -I/usr/dt/include
GLUT_CFLAGS = -DSOLARIS_2_4_BUG
GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lCrun

View File

@ -9,10 +9,8 @@ CC = cc
CXX = CC
CFLAGS = -xarch=v8 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -xarch=v8 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DPTHREADS
GLUT_CFLAGS = -DSOLARIS_2_4_BUG
GL_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -lX11 -lXext -lXmu -lXi -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCstd -lCrun
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@ -11,6 +11,5 @@ CC = cc
CXX = CC
CFLAGS = -xarch=v8 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -xarch=v8 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DPTHREADS
GLUT_CFLAGS = -DSOLARIS_2_4_BUG
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11 -lXext -lXmu -lXi -lpthread -lm -lCstd -lCrun

View File

@ -13,11 +13,9 @@ CC = cc
CXX = CC
CFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DPTHREADS
GLUT_CFLAGS = -DSOLARIS_2_4_BUG
GL_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -lX11 -lXext -lXmu -lXi -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCstd -lCrun
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@ -26,10 +26,8 @@ CXXFLAGS += -fno-strict-aliasing
CFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DPTHREADS
#CXXFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DPTHREADS
GLUT_CFLAGS = -DSOLARIS_2_4_BUG
GL_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -lX11 -lXext -lXmu -lXi -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCstd -lCrun
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@ -13,6 +13,5 @@ CC = cc
CXX = CC
CFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -xarch=v9 -KPIC -O -I/usr/openwin/include -I/usr/dt/include -DPTHREADS
GLUT_CFLAGS = -DSOLARIS_2_4_BUG
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11 -lXext -lXmu -lXi -lpthread -lm -lCstd -lCrun

View File

@ -9,7 +9,6 @@ CC = gcc
CXX = g++
CFLAGS = -pedantic -O2
CXXFLAGS = -pedantic -O2
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static
# Work around aliasing bugs - developers should comment this out
@ -18,7 +17,6 @@ CXXFLAGS += -fno-strict-aliasing
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@ -1678,65 +1678,6 @@ AC_SUBST([GLW_PC_REQ_PRIV])
AC_SUBST([GLW_PC_LIB_PRIV])
AC_SUBST([GLW_PC_CFLAGS])
dnl
dnl GLUT configuration
dnl
if test -f "$srcdir/include/GL/glut.h"; then
default_glut=yes
else
default_glut=no
fi
AC_ARG_ENABLE([glut],
[AS_HELP_STRING([--disable-glut],
[enable GLUT library @<:@default=enabled if source available@:>@])],
[enable_glut="$enableval"],
[enable_glut="$default_glut"])
dnl Don't build glut without GLX
if test "x$enable_glut" = xyes -a "x$enable_glx" = xno; then
AC_MSG_NOTICE([Disabling glut since there is no OpenGL driver])
enable_glut=no
fi
dnl Can't build glut if GLU not available
if test "x$enable_glu$enable_glut" = xnoyes; then
AC_MSG_WARN([Disabling glut since GLU is disabled])
enable_glut=no
fi
if test "x$enable_glut" = xyes; then
SRC_DIRS="$SRC_DIRS glut/glx"
if test "$x11_pkgconfig" = yes; then
PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
GLUT_PC_REQ_PRIV="x11 xmu xi"
GLUT_LIB_DEPS="$GLUT_LIBS"
else
# should check these...
GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
GLUT_PC_CFLAGS="$X11_INCLUDES"
fi
if test "x$GCC" = xyes; then
GLUT_CFLAGS="$GLUT_CFLAGS -fexceptions"
fi
GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm"
# If static, empty GLUT_LIB_DEPS and add libs for programs to link
if test "$enable_static" = no; then
GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
else
APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
GLUT_LIB_DEPS=""
GLUT_MESA_DEPS=""
fi
fi
AC_SUBST([GLUT_LIB_DEPS])
AC_SUBST([GLUT_MESA_DEPS])
AC_SUBST([GLUT_CFLAGS])
AC_SUBST([GLUT_PC_REQ_PRIV])
AC_SUBST([GLUT_PC_LIB_PRIV])
AC_SUBST([GLUT_PC_CFLAGS])
dnl
dnl Program library dependencies
dnl Only libm is added here if necessary as the libraries should
@ -2099,7 +2040,6 @@ esac
echo ""
echo " GLU: $enable_glu"
echo " GLw: $enable_glw (Motif: $enable_motif)"
echo " glut: $enable_glut"
dnl EGL
echo ""

View File

@ -21,7 +21,6 @@
<ul>
<li><a href="#glu">GLU</a></li>
<li><a href="#glw">GLw</a></li>
<li><a href="#glut">GLUT</a></li>
</ul>
<li><a href="#demos">Demo Program Options</a></li>
</ol>
@ -252,13 +251,6 @@ on all drivers. This can be disable with the option
if libGLU has been enabled. This can be disable with the option
<code>--disable-glw</code>.
</li>
<a name="glut">
<li><b><em>GLUT</em></b> - The libglut library will be built by default
if libGLU has been enabled and the glut source code from the MesaGLUT
tarball is available. This can be disable with the option
<code>--disable-glut</code>.
</li>
</ul>
</p>

View File

@ -160,12 +160,6 @@ Then: <code>git push origin mesa_X_Y</code>
<H3>Make the tarballs</H3>
<p>
Make a symbolic link from $(DIRECTORY) to 'Mesa'. For example,
<code>ln -s Mesa Mesa-7.5</code>
This is needed in order to make a correct tar file in the next step.
</p>
<p>
Make the distribution files. From inside the Mesa directory:
<pre>

View File

@ -25,9 +25,8 @@ The Mesa package is named MesaLib-x.y.z.{tar.bz2, tar.gz, zip} where x.y.z
is the version. There are three types of compressed archives.
</p>
<p>
There's also the MesaGLUT-x.y.z.{tar.bz2, tar.gz, zip} packages which
contain Mark Kilgard's GLUT library.
This is optional.
In the past, there was also MesaGLUT-x.y.z.{tar.bz2, tar.gz, zip} packages which
contained Mark Kilgard's GLUT library.
Most Linux distributions include an implementation of GLUT (such as freeglut).
</p>
<p>

View File

@ -198,9 +198,9 @@ Mesa's not the solution.
<h2><a name="part2">2.3 Where is the GLUT library?</a></h2>
<p>
<a name="part2">GLUT (OpenGL Utility Toolkit) is in the separate MesaGLUT-x.y.z.tar.gz file.
If you don't already have GLUT installed, you should grab the MesaGLUT
package and compile it with the rest of Mesa.
<a name="part2">GLUT (OpenGL Utility Toolkit) is no longer in the separate MesaGLUT-x.y.z.tar.gz file.
If you don't already have GLUT installed, you should grab
<a href="http://freeglut.sourceforge.net/">freeglut</a>.
</a></p>

View File

@ -38,10 +38,10 @@ target="_parent">Silicon Graphics Incorporated</a>.
<p>
The Mesa distribution consists of several components. Different copyrights
and licenses apply to different components. For example, GLUT is copyrighted
by Mark Kilgard, some demo programs are copyrighted by SGI, some of the Mesa
device drivers are copyrighted by their authors. See below for a list of
Mesa's main components and the license for each.
and licenses apply to different components. For example, some demo programs
are copyrighted by SGI, some of the Mesa device drivers are copyrighted by
their authors. See below for a list of Mesa's main components and the license
for each.
</p>
<p>
The core Mesa library is licensed according to the terms of the MIT license.

View File

@ -150,7 +150,6 @@ each directory.
<li><b>sgi</b> - GLU from SGI
<li><b>mesa</b> - Mesa version of GLU (deprecated)
</ul>
<li><b>glut</b> - Mark Kilgard's OpenGL OpenGL Utility Toolkit library
<li><b>glx</b> - The GLX library code for building libGL. This is used for
direct rendering drivers. It will dynamically load one of the
xxx_dri.so drivers.

View File

@ -1,665 +0,0 @@
#ifndef __glut_h__
#define __glut_h__
/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 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. */
#if defined(_WIN32)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN 1
# endif
# include <windows.h>
#endif
#include <GL/gl.h>
#include <GL/glu.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_WIN32)
/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
in your compile preprocessor options. */
# if defined(_MSC_VER) && !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
/* To enable automatic SGI OpenGL for Windows library usage for GLUT,
define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */
# ifdef GLUT_USE_SGI_OPENGL
# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */
# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */
# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */
# else
# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */
# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
# endif
# endif
/* To disable supression of annoying warnings about floats being promoted
to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
options. */
# if defined(_MSC_VER) && !defined(GLUT_NO_WARNING_DISABLE)
# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */
# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
# endif
/* Win32 has an annoying issue where there are multiple C run-time
libraries (CRTs). If the executable is linked with a different CRT
from the GLUT DLL, the GLUT DLL will not share the same CRT static
data seen by the executable. In particular, atexit callbacks registered
in the executable will not be called if GLUT calls its (different)
exit routine). GLUT is typically built with the
"/MD" option (the CRT with multithreading DLL support), but the Visual
C++ linker default is "/ML" (the single threaded CRT).
One workaround to this issue is requiring users to always link with
the same CRT as GLUT is compiled with. That requires users supply a
non-standard option. GLUT 3.7 has its own built-in workaround where
the executable's "exit" function pointer is covertly passed to GLUT.
GLUT then calls the executable's exit function pointer to ensure that
any "atexit" calls registered by the application are called if GLUT
needs to exit.
Note that the __glut*WithExit routines should NEVER be called directly.
To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
/* XXX This is from Win32's <process.h> */
# if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__cdecl)
/* Define __cdecl for non-Microsoft compilers. */
# define __cdecl
# define GLUT_DEFINED___CDECL
# endif
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
#include <stdlib.h>
#endif
/* GLUT callback calling convention for Win32. */
# define GLUTCALLBACK __cdecl
/* for callback/function pointer defs */
# define GLUTAPIENTRYV __cdecl
/* glut-win32 specific macros, defined to prevent collision with
and redifinition of Windows system defs, also removes requirement of
pretty much any standard windows header from this file */
#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
# define GLUTAPIENTRY __stdcall
#else
# define GLUTAPIENTRY
#endif
/* GLUT API entry point declarations for Win32. */
#if (defined(BUILD_GLUT32) || defined(GLUT_BUILDING_LIB)) && !defined(GLUT_STATIC)
# define GLUTAPI __declspec(dllexport)
#elif !defined(GLUT_STATIC)
# define GLUTAPI __declspec(dllimport)
#else
# define GLUTAPI extern
#endif
#elif defined(__GNUC__)
# define GLUTAPIENTRY
# define GLUTAPIENTRYV
# define GLUTCALLBACK
# define GLUTAPI extern __attribute__((visibility("default")))
#else
/* Define GLUTAPIENTRY and GLUTCALLBACK to nothing */
# define GLUTAPIENTRY
# define GLUTAPIENTRYV
# define GLUTCALLBACK
# define GLUTAPI extern
#endif
/**
GLUT API revision history:
GLUT_API_VERSION is updated to reflect incompatible GLUT
API changes (interface changes, semantic changes, deletions,
or additions).
GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
extension. Supports new input devices like tablet, dial and button
box, and Spaceball. Easy to query OpenGL extensions.
GLUT_API_VERSION=3 glutMenuStatus added.
GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!).
GLUT_API_VERSION=5 glutGetProcAddress (added by BrianP)
**/
#ifndef GLUT_API_VERSION /* allow this to be overriden */
#define GLUT_API_VERSION 5
#endif
/**
GLUT implementation revision history:
GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
API revisions and implementation revisions (ie, bug fixes).
GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
GLUT Xlib-based implementation. 11/29/94
GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
GLUT Xlib-based implementation providing GLUT version 2
interfaces.
GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
and video resize. 1/3/97
GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h>
**/
#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
#define GLUT_XLIB_IMPLEMENTATION 15
#endif
/* Display mode bit masks. */
#define GLUT_RGB 0
#define GLUT_RGBA GLUT_RGB
#define GLUT_INDEX 1
#define GLUT_SINGLE 0
#define GLUT_DOUBLE 2
#define GLUT_ACCUM 4
#define GLUT_ALPHA 8
#define GLUT_DEPTH 16
#define GLUT_STENCIL 32
#if (GLUT_API_VERSION >= 2)
#define GLUT_MULTISAMPLE 128
#define GLUT_STEREO 256
#endif
#if (GLUT_API_VERSION >= 3)
#define GLUT_LUMINANCE 512
#endif
/* Mouse buttons. */
#define GLUT_LEFT_BUTTON 0
#define GLUT_MIDDLE_BUTTON 1
#define GLUT_RIGHT_BUTTON 2
/* Mouse button state. */
#define GLUT_DOWN 0
#define GLUT_UP 1
#if (GLUT_API_VERSION >= 2)
/* function keys */
#define GLUT_KEY_F1 1
#define GLUT_KEY_F2 2
#define GLUT_KEY_F3 3
#define GLUT_KEY_F4 4
#define GLUT_KEY_F5 5
#define GLUT_KEY_F6 6
#define GLUT_KEY_F7 7
#define GLUT_KEY_F8 8
#define GLUT_KEY_F9 9
#define GLUT_KEY_F10 10
#define GLUT_KEY_F11 11
#define GLUT_KEY_F12 12
/* directional keys */
#define GLUT_KEY_LEFT 100
#define GLUT_KEY_UP 101
#define GLUT_KEY_RIGHT 102
#define GLUT_KEY_DOWN 103
#define GLUT_KEY_PAGE_UP 104
#define GLUT_KEY_PAGE_DOWN 105
#define GLUT_KEY_HOME 106
#define GLUT_KEY_END 107
#define GLUT_KEY_INSERT 108
#endif
/* Entry/exit state. */
#define GLUT_LEFT 0
#define GLUT_ENTERED 1
/* Menu usage state. */
#define GLUT_MENU_NOT_IN_USE 0
#define GLUT_MENU_IN_USE 1
/* Visibility state. */
#define GLUT_NOT_VISIBLE 0
#define GLUT_VISIBLE 1
/* Window status state. */
#define GLUT_HIDDEN 0
#define GLUT_FULLY_RETAINED 1
#define GLUT_PARTIALLY_RETAINED 2
#define GLUT_FULLY_COVERED 3
/* Color index component selection values. */
#define GLUT_RED 0
#define GLUT_GREEN 1
#define GLUT_BLUE 2
/* Layers for use. */
#define GLUT_NORMAL 0
#define GLUT_OVERLAY 1
#if defined(_WIN32) || defined (GLUT_IMPORT_LIB)
/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN ((void*)0)
#define GLUT_STROKE_MONO_ROMAN ((void*)1)
/* Bitmap font constants (use these in GLUT program). */
#define GLUT_BITMAP_9_BY_15 ((void*)2)
#define GLUT_BITMAP_8_BY_13 ((void*)3)
#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
#if (GLUT_API_VERSION >= 3)
#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
#endif
#else
/* Stroke font opaque addresses (use constants instead in source code). */
GLUTAPI void *glutStrokeRoman;
GLUTAPI void *glutStrokeMonoRoman;
/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN (&glutStrokeRoman)
#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
/* Bitmap font opaque addresses (use constants instead in source code). */
GLUTAPI void *glutBitmap9By15;
GLUTAPI void *glutBitmap8By13;
GLUTAPI void *glutBitmapTimesRoman10;
GLUTAPI void *glutBitmapTimesRoman24;
GLUTAPI void *glutBitmapHelvetica10;
GLUTAPI void *glutBitmapHelvetica12;
GLUTAPI void *glutBitmapHelvetica18;
/* Bitmap font constants (use these in GLUT program). */
#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
#if (GLUT_API_VERSION >= 3)
#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
#endif
#endif
/* glutGet parameters. */
#define GLUT_WINDOW_X 100
#define GLUT_WINDOW_Y 101
#define GLUT_WINDOW_WIDTH 102
#define GLUT_WINDOW_HEIGHT 103
#define GLUT_WINDOW_BUFFER_SIZE 104
#define GLUT_WINDOW_STENCIL_SIZE 105
#define GLUT_WINDOW_DEPTH_SIZE 106
#define GLUT_WINDOW_RED_SIZE 107
#define GLUT_WINDOW_GREEN_SIZE 108
#define GLUT_WINDOW_BLUE_SIZE 109
#define GLUT_WINDOW_ALPHA_SIZE 110
#define GLUT_WINDOW_ACCUM_RED_SIZE 111
#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112
#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114
#define GLUT_WINDOW_DOUBLEBUFFER 115
#define GLUT_WINDOW_RGBA 116
#define GLUT_WINDOW_PARENT 117
#define GLUT_WINDOW_NUM_CHILDREN 118
#define GLUT_WINDOW_COLORMAP_SIZE 119
#if (GLUT_API_VERSION >= 2)
#define GLUT_WINDOW_NUM_SAMPLES 120
#define GLUT_WINDOW_STEREO 121
#endif
#if (GLUT_API_VERSION >= 3)
#define GLUT_WINDOW_CURSOR 122
#endif
#define GLUT_SCREEN_WIDTH 200
#define GLUT_SCREEN_HEIGHT 201
#define GLUT_SCREEN_WIDTH_MM 202
#define GLUT_SCREEN_HEIGHT_MM 203
#define GLUT_MENU_NUM_ITEMS 300
#define GLUT_DISPLAY_MODE_POSSIBLE 400
#define GLUT_INIT_WINDOW_X 500
#define GLUT_INIT_WINDOW_Y 501
#define GLUT_INIT_WINDOW_WIDTH 502
#define GLUT_INIT_WINDOW_HEIGHT 503
#define GLUT_INIT_DISPLAY_MODE 504
#if (GLUT_API_VERSION >= 2)
#define GLUT_ELAPSED_TIME 700
#endif
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
#define GLUT_WINDOW_FORMAT_ID 123
#endif
#if (GLUT_API_VERSION >= 2)
/* glutDeviceGet parameters. */
#define GLUT_HAS_KEYBOARD 600
#define GLUT_HAS_MOUSE 601
#define GLUT_HAS_SPACEBALL 602
#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
#define GLUT_HAS_TABLET 604
#define GLUT_NUM_MOUSE_BUTTONS 605
#define GLUT_NUM_SPACEBALL_BUTTONS 606
#define GLUT_NUM_BUTTON_BOX_BUTTONS 607
#define GLUT_NUM_DIALS 608
#define GLUT_NUM_TABLET_BUTTONS 609
#endif
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610
#define GLUT_DEVICE_KEY_REPEAT 611
#define GLUT_HAS_JOYSTICK 612
#define GLUT_OWNS_JOYSTICK 613
#define GLUT_JOYSTICK_BUTTONS 614
#define GLUT_JOYSTICK_AXES 615
#define GLUT_JOYSTICK_POLL_RATE 616
#endif
#if (GLUT_API_VERSION >= 3)
/* glutLayerGet parameters. */
#define GLUT_OVERLAY_POSSIBLE 800
#define GLUT_LAYER_IN_USE 801
#define GLUT_HAS_OVERLAY 802
#define GLUT_TRANSPARENT_INDEX 803
#define GLUT_NORMAL_DAMAGED 804
#define GLUT_OVERLAY_DAMAGED 805
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
/* glutVideoResizeGet parameters. */
#define GLUT_VIDEO_RESIZE_POSSIBLE 900
#define GLUT_VIDEO_RESIZE_IN_USE 901
#define GLUT_VIDEO_RESIZE_X_DELTA 902
#define GLUT_VIDEO_RESIZE_Y_DELTA 903
#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904
#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
#define GLUT_VIDEO_RESIZE_X 906
#define GLUT_VIDEO_RESIZE_Y 907
#define GLUT_VIDEO_RESIZE_WIDTH 908
#define GLUT_VIDEO_RESIZE_HEIGHT 909
#endif
/* glutUseLayer parameters. */
#define GLUT_NORMAL 0
#define GLUT_OVERLAY 1
/* glutGetModifiers return mask. */
#define GLUT_ACTIVE_SHIFT 1
#define GLUT_ACTIVE_CTRL 2
#define GLUT_ACTIVE_ALT 4
/* glutSetCursor parameters. */
/* Basic arrows. */
#define GLUT_CURSOR_RIGHT_ARROW 0
#define GLUT_CURSOR_LEFT_ARROW 1
/* Symbolic cursor shapes. */
#define GLUT_CURSOR_INFO 2
#define GLUT_CURSOR_DESTROY 3
#define GLUT_CURSOR_HELP 4
#define GLUT_CURSOR_CYCLE 5
#define GLUT_CURSOR_SPRAY 6
#define GLUT_CURSOR_WAIT 7
#define GLUT_CURSOR_TEXT 8
#define GLUT_CURSOR_CROSSHAIR 9
/* Directional cursors. */
#define GLUT_CURSOR_UP_DOWN 10
#define GLUT_CURSOR_LEFT_RIGHT 11
/* Sizing cursors. */
#define GLUT_CURSOR_TOP_SIDE 12
#define GLUT_CURSOR_BOTTOM_SIDE 13
#define GLUT_CURSOR_LEFT_SIDE 14
#define GLUT_CURSOR_RIGHT_SIDE 15
#define GLUT_CURSOR_TOP_LEFT_CORNER 16
#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
/* Inherit from parent window. */
#define GLUT_CURSOR_INHERIT 100
/* Blank cursor. */
#define GLUT_CURSOR_NONE 101
/* Fullscreen crosshair (if available). */
#define GLUT_CURSOR_FULL_CROSSHAIR 102
#endif
/* GLUT initialization sub-API. */
GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
#ifndef GLUT_BUILDING_LIB
#define glutInit(__argcp, __argv) __glutInitWithExit(__argcp, __argv, exit)
#endif
#endif
GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string);
#endif
GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y);
GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height);
GLUTAPI void GLUTAPIENTRY glutMainLoop(void);
/* GLUT window sub-API. */
GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title);
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
#ifndef GLUT_BUILDING_LIB
#define glutCreateWindow(__title) __glutCreateWindowWithExit(__title, exit)
#endif
#endif
GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win);
GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win);
#endif
GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void);
GLUTAPI int GLUTAPIENTRY glutGetWindow(void);
GLUTAPI void GLUTAPIENTRY glutSetWindow(int win);
GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title);
GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title);
GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y);
GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height);
GLUTAPI void GLUTAPIENTRY glutPopWindow(void);
GLUTAPI void GLUTAPIENTRY glutPushWindow(void);
GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void);
GLUTAPI void GLUTAPIENTRY glutShowWindow(void);
GLUTAPI void GLUTAPIENTRY glutHideWindow(void);
#if (GLUT_API_VERSION >= 3)
GLUTAPI void GLUTAPIENTRY glutFullScreen(void);
GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y);
#endif
/* GLUT overlay sub-API. */
GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void);
GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void);
GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer);
GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win);
#endif
GLUTAPI void GLUTAPIENTRY glutShowOverlay(void);
GLUTAPI void GLUTAPIENTRY glutHideOverlay(void);
#endif
/* GLUT menu sub-API. */
GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
#ifndef GLUT_BUILDING_LIB
#define glutCreateMenu(__func) __glutCreateMenuWithExit(__func, exit)
#endif
#endif
GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu);
GLUTAPI int GLUTAPIENTRY glutGetMenu(void);
GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu);
GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value);
GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu);
GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item);
GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button);
GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button);
/* GLUT window callback sub-API. */
GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
#if (GLUT_API_VERSION >= 2)
GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
#if (GLUT_API_VERSION >= 3)
GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
#endif
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
#endif
#endif
#endif
/* GLUT color index sub-API. */
GLUTAPI void GLUTAPIENTRY glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue);
GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component);
GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win);
/* GLUT state retrieval sub-API. */
GLUTAPI int GLUTAPIENTRY glutGet(GLenum type);
GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type);
#if (GLUT_API_VERSION >= 2)
/* GLUT extension support sub-API */
GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name);
#endif
#if (GLUT_API_VERSION >= 3)
GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
#endif
#if (GLUT_API_VERSION >= 5)
typedef void (*GLUTproc)();
GLUTAPI GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName);
#endif
/* GLUT font sub-API */
GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character);
GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character);
GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character);
GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string);
GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string);
#endif
/* GLUT pre-built models sub-API */
GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size);
GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size);
GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void);
GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void);
GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size);
GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size);
GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void);
GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void);
GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void);
GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void);
GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void);
GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
/* GLUT video resize sub-API. */
GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param);
GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void);
GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void);
GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height);
GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height);
/* GLUT debugging sub-API. */
GLUTAPI void GLUTAPIENTRY glutReportErrors(void);
#endif
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
/* GLUT device control sub-API. */
/* glutSetKeyRepeat modes. */
#define GLUT_KEY_REPEAT_OFF 0
#define GLUT_KEY_REPEAT_ON 1
#define GLUT_KEY_REPEAT_DEFAULT 2
/* Joystick button masks. */
#define GLUT_JOYSTICK_BUTTON_A 1
#define GLUT_JOYSTICK_BUTTON_B 2
#define GLUT_JOYSTICK_BUTTON_C 4
#define GLUT_JOYSTICK_BUTTON_D 8
GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore);
GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode);
GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void);
/* GLUT game mode sub-API. */
/* glutGameModeGet. */
#define GLUT_GAME_MODE_ACTIVE 0
#define GLUT_GAME_MODE_POSSIBLE 1
#define GLUT_GAME_MODE_WIDTH 2
#define GLUT_GAME_MODE_HEIGHT 3
#define GLUT_GAME_MODE_PIXEL_DEPTH 4
#define GLUT_GAME_MODE_REFRESH_RATE 5
#define GLUT_GAME_MODE_DISPLAY_CHANGED 6
GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string);
GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void);
GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void);
GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
#endif
#ifdef __cplusplus
}
#endif
#endif /* __glut_h__ */

View File

@ -1,81 +0,0 @@
#ifndef __glutf90_h__
#define __glutf90_h__
/* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 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. */
/* This header provides the binding interface for William Mitchell's
f90gl Fortran 90 GLUT binding. Other GLUT language bindings
can and should use this interace. */
/* 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 <GL/glut.h>
/* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */
/* NOTE These values are part of a binary interface for the f90gl Fortran
90 binding and so must NOT changes (additions are allowed). */
/* GLUTwindow callbacks. */
#define GLUT_FCB_DISPLAY 0 /* GLUTdisplayFCB */
#define GLUT_FCB_RESHAPE 1 /* GLUTreshapeFCB */
#define GLUT_FCB_MOUSE 2 /* GLUTmouseFCB */
#define GLUT_FCB_MOTION 3 /* GLUTmotionFCB */
#define GLUT_FCB_PASSIVE 4 /* GLUTpassiveFCB */
#define GLUT_FCB_ENTRY 5 /* GLUTentryFCB */
#define GLUT_FCB_KEYBOARD 6 /* GLUTkeyboardFCB */
#define GLUT_FCB_KEYBOARD_UP 7 /* GLUTkeyboardFCB */
#define GLUT_FCB_WINDOW_STATUS 8 /* GLUTwindowStatusFCB */
#define GLUT_FCB_VISIBILITY 9 /* GLUTvisibilityFCB */
#define GLUT_FCB_SPECIAL 10 /* GLUTspecialFCB */
#define GLUT_FCB_SPECIAL_UP 11 /* GLUTspecialFCB */
#define GLUT_FCB_BUTTON_BOX 12 /* GLUTbuttonBoxFCB */
#define GLUT_FCB_DIALS 13 /* GLUTdialsFCB */
#define GLUT_FCB_SPACE_MOTION 14 /* GLUTspaceMotionFCB */
#define GLUT_FCB_SPACE_ROTATE 15 /* GLUTspaceRotateFCB */
#define GLUT_FCB_SPACE_BUTTON 16 /* GLUTspaceButtonFCB */
#define GLUT_FCB_TABLET_MOTION 17 /* GLUTtabletMotionFCB */
#define GLUT_FCB_TABLET_BUTTON 18 /* GLUTtabletButtonFCB */
#define GLUT_FCB_JOYSTICK 19 /* GLUTjoystickFCB */
/* Non-GLUTwindow callbacks. */
#define GLUT_FCB_OVERLAY_DISPLAY 100 /* GLUTdisplayFCB */
#define GLUT_FCB_SELECT 101 /* GLUTselectFCB */
#define GLUT_FCB_TIMER 102 /* GLUTtimerFCB */
/* GLUT Fortran callback function types. */
typedef void (GLUTCALLBACK *GLUTdisplayFCB) (void);
typedef void (GLUTCALLBACK *GLUTreshapeFCB) (int *, int *);
/* NOTE the pressed key is int, not unsigned char for Fortran! */
typedef void (GLUTCALLBACK *GLUTkeyboardFCB) (int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTmouseFCB) (int *, int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTmotionFCB) (int *, int *);
typedef void (GLUTCALLBACK *GLUTpassiveFCB) (int *, int *);
typedef void (GLUTCALLBACK *GLUTentryFCB) (int *);
typedef void (GLUTCALLBACK *GLUTwindowStatusFCB) (int *);
typedef void (GLUTCALLBACK *GLUTvisibilityFCB) (int *);
typedef void (GLUTCALLBACK *GLUTspecialFCB) (int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTbuttonBoxFCB) (int *, int *);
typedef void (GLUTCALLBACK *GLUTdialsFCB) (int *, int *);
typedef void (GLUTCALLBACK *GLUTspaceMotionFCB) (int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTspaceRotateFCB) (int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTspaceButtonFCB) (int *, int *);
typedef void (GLUTCALLBACK *GLUTtabletMotionFCB) (int *, int *);
typedef void (GLUTCALLBACK *GLUTtabletButtonFCB) (int *, int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z);
typedef void (GLUTCALLBACK *GLUTselectFCB) (int *);
typedef void (GLUTCALLBACK *GLUTtimerFCB) (int *);
typedef void (GLUTCALLBACK *GLUTmenuStateFCB) (int *); /* DEPRICATED. */
typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *);
typedef void (GLUTCALLBACK *GLUTidleFCB) (void);
/* Functions that set and return Fortran callback functions. */
GLUTAPI GLUTproc APIENTRY __glutGetFCB(int which);
GLUTAPI void APIENTRY __glutSetFCB(int which, GLUTproc func);
#endif /* __glutf90_h__ */

View File

@ -25,7 +25,6 @@ if env['platform'] != 'embedded':
SConscript('glx/SConscript')
SConscript('egl/main/SConscript')
SConscript('glu/sgi/SConscript')
SConscript('glut/glx/SConscript')
if env['gles']:
SConscript('mapi/shared-glapi/SConscript')

View File

@ -1,99 +0,0 @@
# Makefile for GLUT
#
# NOTICE: The OpenGL Utility Toolkit (GLUT) distribution contains source
# code published in a book titled "Programming OpenGL for the X Window
# System" (ISBN: 0-201-48359-9) published by Addison-Wesley. The
# programs and associated files contained in the distribution were
# developed by Mark J. Kilgard and are Copyright 1994, 1995, 1996 by Mark
# J. Kilgard (unless otherwise noted). The programs are not in the
# public domain, but they are freely distributable without licensing
# fees. These programs are provided without guarantee or warrantee
# expressed or implied.
#
# GLUT source included with Mesa with permission from Mark Kilgard.
# src/glut/beos/Makefile
TOP = ../../..
include $(TOP)/configs/current
GLUT_MAJOR = 3
GLUT_MINOR = 7
GLUT_TINY = 1
CPP_SOURCES = \
glutBlocker.cpp \
glutInit.cpp \
glutWindow.cpp \
glutEvent.cpp \
glutCallback.cpp \
glutOverlay.cpp \
glutGet.cpp \
glutColor.cpp \
glutCursor.cpp \
glutMenu.cpp \
glutDstr.cpp \
beos_x11.cpp
C_SOURCES = \
glut_8x13.c \
glut_9x15.c \
glut_bitmap.c \
glut_bwidth.c \
glut_hel10.c \
glut_hel12.c \
glut_hel18.c \
glut_tr10.c \
glut_tr24.c \
glut_mroman.c \
glut_roman.c \
glut_stroke.c \
glut_swidth.c \
glut_shapes.c \
glut_teapot.c \
glut_vidresize.c \
glut_util.c \
glut_ext.c
OBJECTS = \
$(CPP_SOURCES:.cpp=.o) \
$(C_SOURCES:.c=.o)
INCLUDES = \
-I. \
-I- \
-I$(TOP)/include
# Rules
.cpp.o:
$(CC) -c $< $(INCLUDES) $(CFLAGS) $(GLUT_CFLAGS) -o $@
.c.o:
$(CC) -c $< $(INCLUDES) $(CFLAGS) $(GLUT_CFLAGS) -o $@
# ---- TARGETS
default: $(TOP)/$(LIB_DIR) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
# Create the lib directory if missing
$(TOP)/$(LIB_DIR):
mkdir $(TOP)/$(LIB_DIR)
# Make the library
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
@$(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
$(GLUT_LIB_DEPS) $(OBJECTS)
clean:
-rm -f *.o
depend: $(SOURCES)
rm -f depend
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
include depend

View File

@ -1,180 +0,0 @@
/* Copyright (c) Nate Robins, 1997. */
/* 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. */
#include <Screen.h>
#include <stdio.h>
#include "beos_x11.h"
/* NOTE: These functions require a BApplication to be instantiated first */
int DisplayWidth() {
BScreen s;
return s.Frame().IntegerWidth() + 1;
}
int DisplayHeight() {
BScreen s;
return s.Frame().IntegerHeight() + 1;
}
/* the following function was stolen from the X sources as indicated. */
/* Copyright Massachusetts Institute of Technology 1985, 1986, 1987 */
/*
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of M.I.T. not be used in advertising or
publicity pertaining to distribution of the software without specific,
written prior permission. M.I.T. makes no representations about the
suitability of this software for any purpose. It is provided "as is"
without express or implied warranty.
*/
#if 0 // Not used currently...
/*
*Returns pointer to first char ins search which is also in what, else NULL.
*/
static char *strscan (char *search, char *what)
{
int i, len = strlen (what);
char c;
while ((c = *(search++))) {
for (i = 0; i < len; i++)
if (c == what [i])
return (--search);
}
return (NULL);
}
#endif
/*
* XParseGeometry parses strings of the form
* "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
* width, height, xoffset, and yoffset are unsigned integers.
* Example: "=80x24+300-49"
* The equal sign is optional.
* It returns a bitmask that indicates which of the four values
* were actually found in the string. For each value found,
* the corresponding argument is updated; for each value
* not found, the corresponding argument is left unchanged.
*/
static int
ReadInteger(char *string, char **NextString)
{
register int Result = 0;
int Sign = 1;
if (*string == '+')
string++;
else if (*string == '-')
{
string++;
Sign = -1;
}
for (; (*string >= '0') && (*string <= '9'); string++)
{
Result = (Result * 10) + (*string - '0');
}
*NextString = string;
if (Sign >= 0)
return (Result);
else
return (-Result);
}
int XParseGeometry (char *string, int *x, int *y,
unsigned int *width, unsigned int *height)
{
int mask = NoValue;
register char *strind;
unsigned int tempWidth=0, tempHeight=0;
int tempX=0, tempY=0;
char *nextCharacter;
if ( (string == NULL) || (*string == '\0')) return(mask);
if (*string == '=')
string++; /* ignore possible '=' at beg of geometry spec */
strind = (char *)string;
if (*strind != '+' && *strind != '-' && *strind != 'x') {
tempWidth = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return (0);
strind = nextCharacter;
mask |= WidthValue;
}
if (*strind == 'x' || *strind == 'X') {
strind++;
tempHeight = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return (0);
strind = nextCharacter;
mask |= HeightValue;
}
if ((*strind == '+') || (*strind == '-')) {
if (*strind == '-') {
strind++;
tempX = -ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return (0);
strind = nextCharacter;
mask |= XNegative;
}
else
{ strind++;
tempX = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return(0);
strind = nextCharacter;
}
mask |= XValue;
if ((*strind == '+') || (*strind == '-')) {
if (*strind == '-') {
strind++;
tempY = -ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return(0);
strind = nextCharacter;
mask |= YNegative;
}
else
{
strind++;
tempY = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter)
return(0);
strind = nextCharacter;
}
mask |= YValue;
}
}
/* If strind isn't at the end of the string the it's an invalid
geometry specification. */
if (*strind != '\0') return (0);
if (mask & XValue)
*x = tempX;
if (mask & YValue)
*y = tempY;
if (mask & WidthValue)
*width = tempWidth;
if (mask & HeightValue)
*height = tempHeight;
return (mask);
}

View File

@ -1,33 +0,0 @@
#ifndef __beos_x11_h__
#define __beos_x11_h__
/* Copyright (c) Nate Robins, 1997. */
/* 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. */
/*
* Bitmask returned by XParseGeometry(). Each bit tells if the corresponding
* value (x, y, width, height) was found in the parsed string.
*/
#define NoValue 0x0000
#define XValue 0x0001
#define YValue 0x0002
#define WidthValue 0x0004
#define HeightValue 0x0008
#define AllValues 0x000F
#define XNegative 0x0010
#define YNegative 0x0020
/* Function prototypes. */
extern int DisplayWidth();
extern int DisplayHeight();
extern int XParseGeometry(
char* string,
int* x, int* y,
unsigned int* width, unsigned int* height);
#endif /* __beos_x11_h__ */

View File

@ -1,69 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
* FILE: glutBlocker.cpp
*
* DESCRIPTION: helper class for GLUT event loop.
* if a window receives an event, wake up the event loop.
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include "glutBlocker.h"
/***********************************************************
* Global variable
***********************************************************/
GlutBlocker gBlock;
/***********************************************************
* Member functions
***********************************************************/
GlutBlocker::GlutBlocker() {
gSem = create_sem(1, "gSem");
eSem = create_sem(0, "eSem");
events = false;
sleeping = false;
}
GlutBlocker::~GlutBlocker() {
delete_sem(eSem);
delete_sem(gSem);
}
void GlutBlocker::WaitEvent() {
acquire_sem(gSem);
if(!events) { // wait for new event
sleeping = true;
release_sem(gSem);
acquire_sem(eSem); // next event will release eSem
} else {
release_sem(gSem);
}
}
void GlutBlocker::WaitEvent(bigtime_t usecs) {
acquire_sem(gSem);
if(!events) { // wait for new event
sleeping = true;
release_sem(gSem);
acquire_sem_etc(eSem, 1, B_TIMEOUT, usecs); // wait for next event or timeout
} else {
release_sem(gSem);
}
}
void GlutBlocker::NewEvent() {
acquire_sem(gSem);
events = true; // next call to WaitEvent returns immediately
if(sleeping) {
sleeping = false;
release_sem(eSem); // if event loop is blocking, wake it up
}
release_sem(gSem);
}

View File

@ -1,47 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
* FILE: glutBlocker.h
*
* DESCRIPTION: helper class for GLUT event loop.
* if a window receives an event, wake up the event loop.
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <kernel/OS.h>
/***********************************************************
* CLASS: GlutBlocker
*
* DESCRIPTION: Fairly naive, but safe implementation.
* global semaphore controls access to state
* event semaphore blocks WaitEvent() call if necessary
* (this is basically a condition variable class)
***********************************************************/
class GlutBlocker {
public:
GlutBlocker();
~GlutBlocker();
void WaitEvent(); // wait for new event
void WaitEvent(bigtime_t usecs); // wait with timeout
void NewEvent(); // new event from a window (may need to wakeup main thread)
void QuickNewEvent() { events = true; } // new event from main thread
void ClearEvents() { events = false; } // clear counter at beginning of event loop
bool PendingEvent() { return events; } // XPending() equivalent
private:
sem_id gSem;
sem_id eSem;
bool events; // are there any new events?
bool sleeping; // is someone sleeping on eSem?
};
/***********************************************************
* Global variable
***********************************************************/
extern GlutBlocker gBlock;

View File

@ -1,171 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
*
* FILE: glutCallback.cpp
*
* DESCRIPTION: put all the callback setting routines in
* one place
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include "glutint.h"
#include "glutState.h"
/***********************************************************
* Window related callbacks
***********************************************************/
void APIENTRY
glutDisplayFunc(GLUTdisplayCB displayFunc)
{
/* XXX Remove the warning after GLUT 3.0. */
if (!displayFunc)
__glutFatalError("NULL display callback not allowed in GLUT 3.0; update your code.");
gState.currentWindow->display = displayFunc;
}
void APIENTRY
glutKeyboardFunc(GLUTkeyboardCB keyboardFunc)
{
gState.currentWindow->keyboard = keyboardFunc;
}
void APIENTRY
glutSpecialFunc(GLUTspecialCB specialFunc)
{
gState.currentWindow->special = specialFunc;
}
void APIENTRY
glutMouseFunc(GLUTmouseCB mouseFunc)
{
gState.currentWindow->mouse = mouseFunc;
}
void APIENTRY
glutMotionFunc(GLUTmotionCB motionFunc)
{
gState.currentWindow->motion = motionFunc;
}
void APIENTRY
glutPassiveMotionFunc(GLUTpassiveCB passiveMotionFunc)
{
gState.currentWindow->passive = passiveMotionFunc;
}
void APIENTRY
glutEntryFunc(GLUTentryCB entryFunc)
{
gState.currentWindow->entry = entryFunc;
if (!entryFunc) {
gState.currentWindow->entryState = -1;
}
}
void APIENTRY
glutWindowStatusFunc(GLUTwindowStatusCB windowStatusFunc)
{
gState.currentWindow->windowStatus = windowStatusFunc;
}
static void
visibilityHelper(int status)
{
if (status == GLUT_HIDDEN || status == GLUT_FULLY_COVERED)
gState.currentWindow->visibility(GLUT_NOT_VISIBLE);
else
gState.currentWindow->visibility(GLUT_VISIBLE);
}
void APIENTRY
glutVisibilityFunc(GLUTvisibilityCB visibilityFunc)
{
gState.currentWindow->visibility = visibilityFunc;
if (visibilityFunc)
glutWindowStatusFunc(visibilityHelper);
else
glutWindowStatusFunc(NULL);
}
void APIENTRY
glutReshapeFunc(GLUTreshapeCB reshapeFunc)
{
if (reshapeFunc) {
gState.currentWindow->reshape = reshapeFunc;
} else {
gState.currentWindow->reshape = __glutDefaultReshape;
}
}
/***********************************************************
* General callbacks (timer callback in glutEvent.cpp)
***********************************************************/
/* DEPRICATED, use glutMenuStatusFunc instead. */
void APIENTRY
glutMenuStateFunc(GLUTmenuStateCB menuStateFunc)
{
gState.menuStatus = (GLUTmenuStatusCB) menuStateFunc;
}
void APIENTRY
glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc)
{
gState.menuStatus = menuStatusFunc;
}
void APIENTRY
glutIdleFunc(GLUTidleCB idleFunc)
{
gState.idle = idleFunc;
}
/***********************************************************
* Unsupported callbacks
***********************************************************/
void APIENTRY
glutOverlayDisplayFunc(GLUTdisplayCB displayFunc)
{
}
void APIENTRY
glutSpaceballMotionFunc(GLUTspaceMotionCB spaceMotionFunc)
{
}
void APIENTRY
glutSpaceballRotateFunc(GLUTspaceRotateCB spaceRotateFunc)
{
}
void APIENTRY
glutSpaceballButtonFunc(GLUTspaceButtonCB spaceButtonFunc)
{
}
void APIENTRY
glutButtonBoxFunc(GLUTbuttonBoxCB buttonBoxFunc)
{
}
void APIENTRY
glutDialsFunc(GLUTdialsCB dialsFunc)
{
}
void APIENTRY
glutTabletMotionFunc(GLUTtabletMotionCB tabletMotionFunc)
{
}
void APIENTRY
glutTabletButtonFunc(GLUTtabletButtonCB tabletButtonFunc)
{
}

View File

@ -1,32 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
*
* FILE: glutColor.cpp
*
* DESCRIPTION: we don't support indexed color, so this code is
* really simple
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include "glutint.h"
void glutSetColor(int cell, GLfloat red, GLfloat green, GLfloat blue) {
__glutWarning("glutSetColor: current window is RGBA");
}
GLfloat glutGetColor(int cell, int component) {
__glutWarning("glutGetColor: current window is RGBA");
return -1.0;
}
void glutCopyColormap(int win) {
__glutWarning("glutCopyColormap: color index not supported in BeOS");
}

View File

@ -1,90 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
*
* FILE: glutCursor.cpp
*
* DESCRIPTION: code for handling custom mouse cursors
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include "glutint.h"
#include "glutState.h"
#include "glutCursors.h"
static const unsigned char *cursorTable[] = {
XC_arrow, /* GLUT_CURSOR_RIGHT_ARROW */
XC_top_left_arrow, /* GLUT_CURSOR_LEFT_ARROW */
XC_hand1, /* GLUT_CURSOR_INFO */
XC_pirate, /* GLUT_CURSOR_DESTROY */
XC_question_arrow, /* GLUT_CURSOR_HELP */
XC_exchange, /* GLUT_CURSOR_CYCLE */
XC_spraycan, /* GLUT_CURSOR_SPRAY */
XC_watch, /* GLUT_CURSOR_WAIT */
XC_xterm, /* GLUT_CURSOR_TEXT */
XC_crosshair, /* GLUT_CURSOR_CROSSHAIR */
XC_sb_v_double_arrow, /* GLUT_CURSOR_UP_DOWN */
XC_sb_h_double_arrow, /* GLUT_CURSOR_LEFT_RIGHT */
XC_top_side, /* GLUT_CURSOR_TOP_SIDE */
XC_bottom_side, /* GLUT_CURSOR_BOTTOM_SIDE */
XC_left_side, /* GLUT_CURSOR_LEFT_SIDE */
XC_right_side, /* GLUT_CURSOR_RIGHT_SIDE */
XC_top_left_corner, /* GLUT_CURSOR_TOP_LEFT_CORNER */
XC_top_right_corner, /* GLUT_CURSOR_TOP_RIGHT_CORNER */
XC_bottom_right_corner, /* GLUT_CURSOR_BOTTOM_RIGHT_CORNER */
XC_bottom_left_corner, /* GLUT_CURSOR_BOTTOM_LEFT_CORNER */
};
/***********************************************************
* FUNCTION: glutSetCursor (4.13)
*
* DESCRIPTION: set a new mouse cursor for current window
***********************************************************/
void glutSetCursor(int cursor) {
gState.currentWindow->Window()->Lock();
gState.currentWindow->cursor = cursor;
__glutSetCursor(cursor);
gState.currentWindow->Window()->Unlock();
}
/***********************************************************
* FUNCTION: __glutSetCursor
*
* DESCRIPTION: the actual cursor changing routine
***********************************************************/
void __glutSetCursor(int cursor) {
int realcursor = cursor;
if (cursor < 0 || cursor > GLUT_CURSOR_BOTTOM_LEFT_CORNER) {
switch(cursor) {
case GLUT_CURSOR_INHERIT:
return; // don't change cursor
case GLUT_CURSOR_NONE:
// this hides the cursor until the user moves the mouse
// change it to HideCursor() AT YOUR OWN RISK!
be_app->ObscureCursor();
return;
case GLUT_CURSOR_FULL_CROSSHAIR:
realcursor = GLUT_CURSOR_CROSSHAIR;
break;
default:
__glutWarning("unknown cursor\n");
return;
}
}
be_app->SetCursor(cursorTable[realcursor]);
}
/***********************************************************
* FUNCTION: glutWarpPointer (x.xx)
*
* DESCRIPTION: move the mouse pointer to a new location
* (note: can't do this in BeOS!)
***********************************************************/
void glutWarpPointer(int x, int y) { }

File diff suppressed because it is too large Load Diff

View File

@ -1,83 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
*
* FILE: glutDstr.cpp
*
* DESCRIPTION: convert display string into a Be options variable
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include <string.h>
#include <stdlib.h>
#include "glutint.h"
#include "glutState.h"
/***********************************************************
* FUNCTION: glutInitDisplayString
*
* DESCRIPTION: sets the display string variable
***********************************************************/
void APIENTRY
glutInitDisplayString(const char *string)
{
if (gState.displayString) {
free(gState.displayString);
}
if (string) {
gState.displayString = strdup(string);
if (!gState.displayString)
__glutFatalError("out of memory.");
} else
gState.displayString = NULL;
}
/***********************************************************
* FUNCTION: __glutConvertDisplayModeFromString
*
* DESCRIPTION: converts the current display mode into a BGLView
* display mode, printing warnings as appropriate.
*
* PARAMETERS: if options is non-NULL, the current display mode is
* returned in it.
*
* RETURNS: 1 if the current display mode is possible, else 0
***********************************************************/
int __glutConvertDisplayModeFromString(unsigned long *options) {
ulong newoptions = 0;
char *word = strtok(gState.displayString, " \t");
do {
char *cstr = strpbrk(word, "=><!~");
if(cstr)
*cstr = '\0';
// this is the most minimal possible parser. scan for
// options that we support, and add them to newoptions
// this will certainly cause it to accept things that we
// don't actually support, but if we don't support it, the
// program's probably not going to work anyway.
if(!strcmp(word, "alpha")) {
newoptions |= BGL_ALPHA;
} else if((!strcmp(word, "acc")) || (!strcmp(word, "acca"))) {
newoptions |= BGL_ACCUM;
} else if(!strcmp(word, "depth")) {
newoptions |= BGL_DEPTH;
} else if(!strcmp(word, "double")) {
newoptions |= BGL_DOUBLE;
} else if(!strcmp(word, "stencil")) {
newoptions |= BGL_STENCIL;
}
} while((word = strtok(0, " \t")) != 0);
if (options)
*options = newoptions;
return 1; // assume we support it
}

View File

@ -1,695 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
*
* FILE: glutEvent.cpp
*
* DESCRIPTION: here it is, the BeOS GLUT event loop
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include "glutint.h"
#include "glutState.h"
#include "glutBlocker.h"
/***********************************************************
* CLASS: GLUTtimer
*
* DESCRIPTION: list of timer callbacks
***********************************************************/
struct GLUTtimer {
GLUTtimer *next; // list of timers
bigtime_t timeout; // time to be called
GLUTtimerCB func; // function to call
int value; // value
};
/***********************************************************
* Private variables
***********************************************************/
static GLUTtimer *__glutTimerList = 0; // list of timer callbacks
static GLUTtimer *freeTimerList = 0;
/***********************************************************
* FUNCTION: glutTimerFunc (7.19)
*
* DESCRIPTION: register a new timer callback
***********************************************************/
void APIENTRY
glutTimerFunc(unsigned int interval, GLUTtimerCB timerFunc, int value)
{
GLUTtimer *timer, *other;
GLUTtimer **prevptr;
if (!timerFunc)
return;
if (freeTimerList) {
timer = freeTimerList;
freeTimerList = timer->next;
} else {
timer = new GLUTtimer();
if (!timer)
__glutFatalError("out of memory.");
}
timer->func = timerFunc;
timer->value = value;
timer->next = NULL;
timer->timeout = system_time() + (interval*1000); // 1000 ticks in a millisecond
prevptr = &__glutTimerList;
other = *prevptr;
while (other && (other->timeout < timer->timeout)) {
prevptr = &other->next;
other = *prevptr;
}
timer->next = other;
*prevptr = timer;
}
/***********************************************************
* FUNCTION: handleTimeouts
*
* DESCRIPTION: private function to handle outstanding timeouts
***********************************************************/
static void
handleTimeouts(void)
{
bigtime_t now;
GLUTtimer *timer;
/* Assumption is that __glutTimerList is already determined
to be non-NULL. */
now = system_time();
while (__glutTimerList->timeout <= now) {
timer = __glutTimerList;
if(gState.currentWindow)
gState.currentWindow->LockGL();
timer->func(timer->value);
if(gState.currentWindow)
gState.currentWindow->UnlockGL();
__glutTimerList = timer->next;
timer->next = freeTimerList;
freeTimerList = timer;
if (!__glutTimerList)
break;
}
}
/***********************************************************
* FUNCTION: processEventsAndTimeouts
*
* DESCRIPTION: clear gBlock, then check all windows for events
***********************************************************/
static void
processEventsAndTimeouts(void)
{
gBlock.WaitEvent(); // if there is already an event, returns
// immediately, otherwise wait forever
gBlock.ClearEvents();
if(gState.quitAll)
exit(0); // exit handler cleans up windows and quits nicely
if (gState.currentWindow)
gState.currentWindow->LockGL();
for(int i=0; i<gState.windowListSize; i++) {
if (gState.windowList[i]) {
GlutWindow *win = gState.windowList[i];
// NOTE: we can use win as a shortcut for gState.windowList[i]
// in callbacks, EXCEPT we need to check the original variable
// after each callback to make sure the window hasn't been destroyed
if (win->anyevents) {
win->anyevents = false;
if (win->reshapeEvent) {
win->reshapeEvent = false;
__glutSetWindow(win);
win->reshape(win->m_width, win->m_height);
}
if (!gState.windowList[i])
continue; // window was destroyed by callback!
if (win->displayEvent) {
win->displayEvent = false;
__glutSetWindow(win);
win->display();
}
if (!gState.windowList[i])
continue; // window was destroyed by callback!
if (win->mouseEvent) {
win->mouseEvent = false;
__glutSetWindow(win);
if (win->mouse) {
gState.modifierKeys = win->modifierKeys;
win->mouse(win->button, win->mouseState, win->mouseX, win->mouseY);
gState.modifierKeys = ~0;
}
}
if (!gState.windowList[i])
continue; // window was destroyed by callback!
if (win->menuEvent) {
win->menuEvent = false;
__glutSetWindow(win);
GlutMenu *menu = __glutGetMenuByNum(win->menuNumber);
if (menu) {
gState.currentMenu = menu;
menu->select(win->menuValue);
}
}
if (!gState.windowList[i])
continue; // window was destroyed by callback!
if (win->statusEvent) {
win->statusEvent = false;
__glutSetWindow(win);
if (gState.menuStatus) {
gState.currentMenu = __glutGetMenuByNum(win->menuNumber);
gState.menuStatus(win->menuStatus, win->statusX, win->statusY);
}
}
if (!gState.windowList[i])
continue; // window was destroyed by callback!
if (win->motionEvent) {
win->motionEvent = false;
__glutSetWindow(win);
if (win->motion)
win->motion(win->motionX, win->motionY);
}
if (!gState.windowList[i])
continue; // window was destroyed by callback!
if (win->passiveEvent) {
win->passiveEvent = false;
__glutSetWindow(win);
if (win->passive)
win->passive(win->passiveX, win->passiveY);
}
if (!gState.windowList[i])
continue; // window was destroyed by callback!
if (win->keybEvent) {
win->keybEvent = false;
__glutSetWindow(win);
if (win->keyboard) {
gState.modifierKeys = win->modifierKeys;
win->keyboard(win->key, win->keyX, win->keyY);
gState.modifierKeys = ~0;
}
}
if (!gState.windowList[i])
continue; // window was destroyed by callback!
if (win->specialEvent) {
win->specialEvent = false;
__glutSetWindow(win);
if (win->special) {
gState.modifierKeys = win->modifierKeys;
win->special(win->specialKey, win->specialX, win->specialY);
gState.modifierKeys = ~0;
}
}
if (!gState.windowList[i])
continue; // window was destroyed by callback!
if (win->entryEvent) {
win->entryEvent = false;
__glutSetWindow(win);
if (win->entry)
win->entry(win->entryState);
}
if (!gState.windowList[i])
continue; // window was destroyed by callback!
if (win->windowStatusEvent) {
win->windowStatusEvent = false;
__glutSetWindow(win);
if (win->windowStatus)
win->windowStatus(win->visState);
}
if (!gState.windowList[i])
continue; // window was destroyed by callback!
}
}
}
if (gState.currentWindow)
gState.currentWindow->UnlockGL();
// This code isn't necessary since BGLView automatically traps errors
#if 0
if(gState.debug) {
for(int i=0; i<gState.windowListSize; i++) {
if (gState.windowList[i]) {
gState.windowList[i]->LockGL();
glutReportErrors();
gState.windowList[i]->UnlockGL();
}
}
}
#endif
if (__glutTimerList) {
handleTimeouts();
}
}
/***********************************************************
* FUNCTION: waitForSomething
*
* DESCRIPTION: use gBlock to wait for a new event or timeout
***********************************************************/
static void
waitForSomething(void)
{
bigtime_t timeout = __glutTimerList->timeout;
bigtime_t now = system_time();
if (gBlock.PendingEvent())
goto immediatelyHandleEvent;
if(timeout>now)
gBlock.WaitEvent(timeout-now);
if (gBlock.PendingEvent()) {
immediatelyHandleEvent:
processEventsAndTimeouts();
} else {
if (__glutTimerList)
handleTimeouts();
}
}
/***********************************************************
* FUNCTION: idleWait
*
* DESCRIPTION: check for events, then call idle function
***********************************************************/
static void
idleWait(void)
{
if (gBlock.PendingEvent()) {
processEventsAndTimeouts();
} else {
if (__glutTimerList)
handleTimeouts();
}
/* Make sure idle func still exists! */
if(gState.currentWindow)
gState.currentWindow->LockGL();
if (gState.idle) {
gState.idle();
}
if(gState.currentWindow)
gState.currentWindow->UnlockGL();
}
/***********************************************************
* FUNCTION: glutMainLoop (3.1)
*
* DESCRIPTION: enter the event processing loop
***********************************************************/
void glutMainLoop()
{
if (!gState.windowListSize)
__glutFatalUsage("main loop entered with no windows created.");
if(gState.currentWindow)
gState.currentWindow->UnlockGL();
for (;;) {
if (gState.idle) {
idleWait();
} else {
if (__glutTimerList) {
waitForSomething();
} else {
processEventsAndTimeouts();
}
}
}
}
/***********************************************************
* CLASS: GlutWindow
*
* FUNCTION: KeyDown
*
* DESCRIPTION: handles keyboard and special events
***********************************************************/
void GlutWindow::KeyDown(const char *s, int32 slen)
{
ulong aChar = s[0];
BGLView::KeyDown(s,slen);
BPoint p;
switch (aChar) {
case B_FUNCTION_KEY:
switch(Window()->CurrentMessage()->FindInt32("key")) {
case B_F1_KEY:
aChar = GLUT_KEY_F1;
goto specialLabel;
case B_F2_KEY:
aChar = GLUT_KEY_F2;
goto specialLabel;
case B_F3_KEY:
aChar = GLUT_KEY_F3;
goto specialLabel;
case B_F4_KEY:
aChar = GLUT_KEY_F4;
goto specialLabel;
case B_F5_KEY:
aChar = GLUT_KEY_F5;
goto specialLabel;
case B_F6_KEY:
aChar = GLUT_KEY_F6;
goto specialLabel;
case B_F7_KEY:
aChar = GLUT_KEY_F7;
goto specialLabel;
case B_F8_KEY:
aChar = GLUT_KEY_F8;
goto specialLabel;
case B_F9_KEY:
aChar = GLUT_KEY_F9;
goto specialLabel;
case B_F10_KEY:
aChar = GLUT_KEY_F10;
goto specialLabel;
case B_F11_KEY:
aChar = GLUT_KEY_F11;
goto specialLabel;
case B_F12_KEY:
aChar = GLUT_KEY_F12;
goto specialLabel;
default:
return;
}
case B_LEFT_ARROW:
aChar = GLUT_KEY_LEFT;
goto specialLabel;
case B_UP_ARROW:
aChar = GLUT_KEY_UP;
goto specialLabel;
case B_RIGHT_ARROW:
aChar = GLUT_KEY_RIGHT;
goto specialLabel;
case B_DOWN_ARROW:
aChar = GLUT_KEY_DOWN;
goto specialLabel;
case B_PAGE_UP:
aChar = GLUT_KEY_PAGE_UP;
goto specialLabel;
case B_PAGE_DOWN:
aChar = GLUT_KEY_PAGE_DOWN;
goto specialLabel;
case B_HOME:
aChar = GLUT_KEY_HOME;
goto specialLabel;
case B_END:
aChar = GLUT_KEY_END;
goto specialLabel;
case B_INSERT:
aChar = GLUT_KEY_INSERT;
specialLabel:
if (special) {
anyevents = specialEvent = true;
GetMouse(&p,&m_buttons);
specialKey = aChar;
specialX = (int)p.x;
specialY = (int)p.y;
goto setModifiers; // set the modifier variable
}
return;
default:
break;
}
if (keyboard) {
anyevents = keybEvent = true;
GetMouse(&p,&m_buttons);
key = aChar;
keyX = (int)p.x;
keyY = (int)p.y;
setModifiers:
modifierKeys = 0;
uint32 beMod = Window()->CurrentMessage()->FindInt32("modifiers");
if(beMod & B_SHIFT_KEY)
modifierKeys |= GLUT_ACTIVE_SHIFT;
if(beMod & B_CONTROL_KEY)
modifierKeys |= GLUT_ACTIVE_CTRL;
if(beMod & B_OPTION_KEY) {
// since the window traps B_COMMAND_KEY, we'll have to settle
// for the option key.. but we need to get the raw character,
// not the Unicode-enhanced version
key = Window()->CurrentMessage()->FindInt32("raw_char");
modifierKeys |= GLUT_ACTIVE_ALT;
}
gBlock.NewEvent();
}
}
/***********************************************************
* CLASS: GlutWindow
*
* FUNCTION: MouseDown
*
* DESCRIPTION: handles mouse and menustatus events
***********************************************************/
void GlutWindow::MouseDown(BPoint point)
{
BGLView::MouseDown(point);
MouseCheck();
}
/***********************************************************
* CLASS: GlutWindow
*
* FUNCTION: MouseCheck
*
* DESCRIPTION: checks for button state changes
***********************************************************/
void GlutWindow::MouseCheck()
{
if (mouseEvent)
return; // we already have an outstanding mouse event
BPoint point;
uint32 newButtons;
GetMouse(&point, &newButtons);
if (m_buttons != newButtons) {
if (newButtons&B_PRIMARY_MOUSE_BUTTON && !(m_buttons&B_PRIMARY_MOUSE_BUTTON)) {
button = GLUT_LEFT_BUTTON;
mouseState = GLUT_DOWN;
} else if (m_buttons&B_PRIMARY_MOUSE_BUTTON && !(newButtons&B_PRIMARY_MOUSE_BUTTON)) {
button = GLUT_LEFT_BUTTON;
mouseState = GLUT_UP;
} else if (newButtons&B_SECONDARY_MOUSE_BUTTON && !(m_buttons&B_SECONDARY_MOUSE_BUTTON)) {
button = GLUT_RIGHT_BUTTON;
mouseState = GLUT_DOWN;
} else if (m_buttons&B_SECONDARY_MOUSE_BUTTON && !(newButtons&B_SECONDARY_MOUSE_BUTTON)) {
button = GLUT_RIGHT_BUTTON;
mouseState = GLUT_UP;
} else if (newButtons&B_TERTIARY_MOUSE_BUTTON && !(m_buttons&B_TERTIARY_MOUSE_BUTTON)) {
button = GLUT_MIDDLE_BUTTON;
mouseState = GLUT_DOWN;
} else if (m_buttons&B_TERTIARY_MOUSE_BUTTON && !(newButtons&B_TERTIARY_MOUSE_BUTTON)) {
button = GLUT_MIDDLE_BUTTON;
mouseState = GLUT_UP;
}
} else {
return; // no change, return
}
m_buttons = newButtons;
if (mouseState == GLUT_DOWN) {
BWindow *w = Window();
GlutMenu *m = __glutGetMenuByNum(menu[button]);
if (m) {
if (gState.menuStatus) {
anyevents = statusEvent = true;
menuNumber = menu[button];
menuStatus = GLUT_MENU_IN_USE;
statusX = (int)point.x;
statusY = (int)point.y;
gBlock.NewEvent();
}
BRect bounds = w->Frame();
point.x += bounds.left;
point.y += bounds.top;
GlutPopUp *bmenu = static_cast<GlutPopUp*>(m->CreateBMenu()); // start menu
bmenu->point = point;
bmenu->win = this;
thread_id menu_thread = spawn_thread(MenuThread, "menu thread", B_NORMAL_PRIORITY, bmenu);
resume_thread(menu_thread);
return;
}
}
if (mouse) {
anyevents = mouseEvent = true;
mouseX = (int)point.x;
mouseY = (int)point.y;
modifierKeys = 0;
uint32 beMod = modifiers();
if(beMod & B_SHIFT_KEY)
modifierKeys |= GLUT_ACTIVE_SHIFT;
if(beMod & B_CONTROL_KEY)
modifierKeys |= GLUT_ACTIVE_CTRL;
if(beMod & B_OPTION_KEY) {
modifierKeys |= GLUT_ACTIVE_ALT;
}
gBlock.NewEvent();
}
}
/***********************************************************
* CLASS: GlutWindow
*
* FUNCTION: MouseMoved
*
* DESCRIPTION: handles entry, motion, and passive events
***********************************************************/
void GlutWindow::MouseMoved(BPoint point,
ulong transit, const BMessage *msg)
{
BGLView::MouseMoved(point,transit,msg);
if(transit != B_INSIDE_VIEW) {
if (entry) {
anyevents = entryEvent = true;
gBlock.NewEvent();
}
if (transit == B_ENTERED_VIEW) {
entryState = GLUT_ENTERED;
MakeFocus(); // make me the current focus
__glutSetCursor(cursor);
} else
entryState = GLUT_LEFT;
}
MouseCheck();
if(m_buttons) {
if(motion) {
anyevents = motionEvent = true;
motionX = (int)point.x;
motionY = (int)point.y;
gBlock.NewEvent();
}
} else {
if(passive) {
anyevents = passiveEvent = true;
passiveX = (int)point.x;
passiveY = (int)point.y;
gBlock.NewEvent();
}
}
}
/***********************************************************
* CLASS: GlutWindow
*
* FUNCTION: FrameResized
*
* DESCRIPTION: handles reshape event
***********************************************************/
void GlutWindow::FrameResized(float width, float height)
{
BGLView::FrameResized(width, height);
if (visible) {
anyevents = reshapeEvent = true;
m_width = (int)(width)+1;
m_height = (int)(height)+1;
gBlock.NewEvent();
}
}
/***********************************************************
* CLASS: GlutWindow
*
* FUNCTION: Draw
*
* DESCRIPTION: handles reshape and display events
***********************************************************/
void GlutWindow::Draw(BRect updateRect)
{
BGLView::Draw(updateRect);
BRect frame = Frame();
if (m_width != (frame.Width()+1) || m_height != (frame.Height()+1)) {
FrameResized(frame.Width(), frame.Height());
}
Window()->Lock();
if (visible) {
anyevents = displayEvent = true;
gBlock.NewEvent();
}
Window()->Unlock();
}
/***********************************************************
* CLASS: GlutWindow
*
* FUNCTION: Pulse
*
* DESCRIPTION: handles mouse up event (MouseUp is broken)
***********************************************************/
void GlutWindow::Pulse()
{
BGLView::Pulse();
if (m_buttons) { // if there are buttons pressed
MouseCheck();
}
}
/***********************************************************
* CLASS: GlutWindow
*
* FUNCTION: ErrorCallback
*
* DESCRIPTION: handles GL error messages
***********************************************************/
void GlutWindow::ErrorCallback(GLenum errorCode) {
__glutWarning("GL error: %s", gluErrorString(errorCode));
}
/***********************************************************
* CLASS: GlutWindow
*
* FUNCTION: MenuThread
*
* DESCRIPTION: a new thread to launch popup menu, wait
* wait for response, then clean up afterwards and
* send appropriate messages
***********************************************************/
long GlutWindow::MenuThread(void *m) {
GlutPopUp *bmenu = static_cast<GlutPopUp*>(m);
GlutWindow *win = bmenu->win; // my window
GlutBMenuItem *result = (GlutBMenuItem*)bmenu->Go(bmenu->point);
win->Window()->Lock();
win->anyevents = win->statusEvent = true;
win->menuStatus = GLUT_MENU_NOT_IN_USE;
win->menuNumber = bmenu->menu;
BPoint cursor;
uint32 buttons;
win->GetMouse(&cursor, &buttons);
win->statusX = (int)cursor.x;
win->statusY = (int)cursor.y;
if(result && result->menu) {
win->menuEvent = true;
win->menuNumber = result->menu; // in case it was a submenu
win->menuValue = result->value;
}
win->Window()->Unlock();
gBlock.NewEvent();
delete bmenu;
return 0;
}

View File

@ -1,211 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
*
* FILE: glutGet.cpp
*
* DESCRIPTION: get state information from GL
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include <string.h>
#include <Autolock.h>
#include <Screen.h>
#include "glutint.h"
#include "glutState.h"
/***********************************************************
* Global variables
***********************************************************/
// rough guess, since we don't know how big the monitor really is
const float dots_per_mm = (72/25.4); // dots per millimeter
/***********************************************************
* FUNCTION: glutGet (9.1)
*
* DESCRIPTION: retrieve window and GL state
***********************************************************/
int glutGet(GLenum state) {
switch(state) {
case GLUT_WINDOW_X:
{BAutolock winlock(gState.currentWindow->Window()); // need to lock the window
if (gState.currentWindow->parent)
return (int)gState.currentWindow->Frame().left;
else
return (int)gState.currentWindow->Window()->Frame().left;
}
case GLUT_WINDOW_Y:
{BAutolock winlock(gState.currentWindow->Window());
if (gState.currentWindow->parent)
return (int)gState.currentWindow->Frame().top;
else
return (int)gState.currentWindow->Window()->Frame().top;
}
case GLUT_WINDOW_WIDTH:
{BAutolock winlock(gState.currentWindow->Window());
return gState.currentWindow->m_width;
}
case GLUT_WINDOW_HEIGHT:
{BAutolock winlock(gState.currentWindow->Window());
return gState.currentWindow->m_height;
}
case GLUT_WINDOW_PARENT:
{BAutolock winlock(gState.currentWindow->Window());
if(gState.currentWindow->parent)
return gState.currentWindow->parent->num + 1;
else
return 0;
}
case GLUT_WINDOW_NUM_CHILDREN:
{BAutolock winlock(gState.currentWindow->Window());
int num = 0;
GlutWindow *children = gState.currentWindow->children;
while (children) {
num++;
children = children->siblings;
}
return num;
}
case GLUT_WINDOW_BUFFER_SIZE: // best guesses
case GLUT_WINDOW_DEPTH_SIZE:
return 32;
case GLUT_WINDOW_STENCIL_SIZE:
case GLUT_WINDOW_RED_SIZE: // always 24-bit color
case GLUT_WINDOW_GREEN_SIZE:
case GLUT_WINDOW_BLUE_SIZE:
case GLUT_WINDOW_ALPHA_SIZE:
case GLUT_WINDOW_ACCUM_RED_SIZE:
case GLUT_WINDOW_ACCUM_GREEN_SIZE:
case GLUT_WINDOW_ACCUM_BLUE_SIZE:
case GLUT_WINDOW_ACCUM_ALPHA_SIZE:
return 8;
case GLUT_WINDOW_DOUBLEBUFFER: // always double-buffered RGBA
case GLUT_WINDOW_RGBA:
return 1;
case GLUT_WINDOW_COLORMAP_SIZE: // don't support these
case GLUT_WINDOW_NUM_SAMPLES:
case GLUT_WINDOW_STEREO:
return 0;
case GLUT_WINDOW_CURSOR:
return gState.currentWindow->cursor; // don't need to lock window since it won't change
case GLUT_SCREEN_WIDTH:
return (int)(BScreen().Frame().Width()) + 1;
case GLUT_SCREEN_HEIGHT:
return (int)(BScreen().Frame().Height()) + 1;
case GLUT_SCREEN_WIDTH_MM:
return (int)((BScreen().Frame().Width() + 1) / dots_per_mm);
case GLUT_SCREEN_HEIGHT_MM:
return (int)((BScreen().Frame().Height() + 1) / dots_per_mm);
case GLUT_MENU_NUM_ITEMS:
return gState.currentMenu->num;
case GLUT_DISPLAY_MODE_POSSIBLE:
return __glutConvertDisplayMode(0); // returns 1 if possible
case GLUT_INIT_DISPLAY_MODE:
return gState.displayMode;
case GLUT_INIT_WINDOW_X:
return gState.initX;
case GLUT_INIT_WINDOW_Y:
return gState.initY;
case GLUT_INIT_WINDOW_WIDTH:
return gState.initWidth;
case GLUT_INIT_WINDOW_HEIGHT:
return gState.initHeight;
case GLUT_ELAPSED_TIME:
bigtime_t elapsed, beginning, now;
__glutInitTime(&beginning);
now = system_time();
elapsed = now - beginning;
return (int) (elapsed / 1000); // 1000 ticks in a millisecond
default:
__glutWarning("invalid glutGet parameter: %d", state);
return -1;
}
}
/***********************************************************
* FUNCTION: glutLayerGet (9.2)
*
* DESCRIPTION: since we don't support layers, this is easy
***********************************************************/
int glutLayerGet(GLenum info) {
switch(info) {
case GLUT_OVERLAY_POSSIBLE:
case GLUT_HAS_OVERLAY:
return 0;
case GLUT_LAYER_IN_USE:
return GLUT_NORMAL;
case GLUT_TRANSPARENT_INDEX:
return -1;
case GLUT_NORMAL_DAMAGED:
return gState.currentWindow->displayEvent;
case GLUT_OVERLAY_DAMAGED:
return -1;
default:
__glutWarning("invalid glutLayerGet param: %d", info);
return -1;
}
}
/***********************************************************
* FUNCTION: glutDeviceGet (9.3)
*
* DESCRIPTION: get info about I/O devices we support
* easy, since BeOS only supports a keyboard and mouse now
***********************************************************/
int glutDeviceGet(GLenum info) {
switch(info) {
case GLUT_HAS_KEYBOARD:
case GLUT_HAS_MOUSE:
return 1;
case GLUT_HAS_SPACEBALL:
case GLUT_HAS_DIAL_AND_BUTTON_BOX:
case GLUT_HAS_TABLET:
case GLUT_NUM_SPACEBALL_BUTTONS:
case GLUT_NUM_BUTTON_BOX_BUTTONS:
case GLUT_NUM_DIALS:
case GLUT_NUM_TABLET_BUTTONS:
return 0;
case GLUT_NUM_MOUSE_BUTTONS:
{
int32 mouseButtons = 3; // good guess
if(get_mouse_type(&mouseButtons) != B_OK) {
__glutWarning("error getting number of mouse buttons");
}
return mouseButtons;
}
default:
__glutWarning("invalid glutDeviceGet parameter: %d", info);
return -1;
}
}
/***********************************************************
* FUNCTION: glutGetModifiers (9.4)
*
* DESCRIPTION: get the modifier key state for the current window
***********************************************************/
int glutGetModifiers() {
if(gState.modifierKeys == (int) ~0) {
__glutWarning(
"glutCurrentModifiers: do not call outside core input callback.");
return 0;
}
return gState.modifierKeys;
}

View File

@ -1,263 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
*
* FILE: glutInit.cpp
*
* DESCRIPTION: initialize GLUT state
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include <string.h>
#include <stdlib.h>
#include <signal.h>
#include "glutint.h"
#include "glutState.h"
#include "glutBlocker.h"
#include "beos_x11.h"
/***********************************************************
* Global variables
***********************************************************/
GlutState gState;
char *__glutProgramName = NULL;
/***********************************************************
* Private variables
***********************************************************/
static int __glutArgc;
static char **__glutArgv;
/***********************************************************
* FUNCTION: __glutInitTime
*
* DESCRIPTION: set up start time variable
***********************************************************/
void __glutInitTime(bigtime_t *beginning)
{
static int beenhere = 0;
static bigtime_t genesis;
if (!beenhere) {
genesis = system_time();
beenhere = 1;
}
*beginning = genesis;
}
/***********************************************************
* FUNCTION: removeArgs
*
* DESCRIPTION: helper function for glutInit to remove args
* from argv variable passed in
***********************************************************/
static void
removeArgs(int *argcp, char **argv, int numToRemove)
{
int i, j;
for (i = 0, j = numToRemove; argv[j]; i++, j++) {
argv[i] = argv[j];
}
argv[i] = NULL;
*argcp -= numToRemove;
}
/***********************************************************
* FUNCTION: bAppThread
*
* DESCRIPTION: starts the BApplication message loop running
***********************************************************/
static int32 bAppThread(void *arg) {
be_app->Lock();
return be_app->Run();
}
/***********************************************************
* FUNCTION: sigHandler
*
* DESCRIPTION: shuts down the app on CTRL-C
***********************************************************/
static void sigHandler(int) {
gState.quitAll = true;
gBlock.NewEvent();
}
/***********************************************************
* FUNCTION: glutInit (2.1)
*
* DESCRIPTION: create BApplication, parse cmd-line arguments,
* and set up gState structure.
***********************************************************/
void glutInit(int *argcp, char **argv) {
char *str, *geometry = NULL;
int i;
if (gState.display) {
__glutWarning("glutInit being called a second time.");
return;
}
/* Determine temporary program name. */
str = strrchr(argv[0], '/');
if (str == NULL) {
__glutProgramName = argv[0];
} else {
__glutProgramName = str + 1;
}
/* Make private copy of command line arguments. */
__glutArgc = *argcp;
__glutArgv = (char **) malloc(__glutArgc * sizeof(char *));
if (!__glutArgv)
__glutFatalError("out of memory.");
for (i = 0; i < __glutArgc; i++) {
__glutArgv[i] = strdup(argv[i]);
if (!__glutArgv[i])
__glutFatalError("out of memory.");
}
/* determine permanent program name */
str = strrchr(__glutArgv[0], '/');
if (str == NULL) {
__glutProgramName = __glutArgv[0];
} else {
__glutProgramName = str + 1;
}
/* parse arguments for standard options */
for (i = 1; i < __glutArgc; i++) {
if (!strcmp(__glutArgv[i], "-display")) {
__glutWarning("-display option only valid for X glut.");
if (++i >= __glutArgc) {
__glutFatalError(
"follow -display option with X display name.");
}
removeArgs(argcp, &argv[1], 2);
} else if (!strcmp(__glutArgv[i], "-geometry")) {
if (++i >= __glutArgc) {
__glutFatalError(
"follow -geometry option with geometry parameter.");
}
geometry = __glutArgv[i];
removeArgs(argcp, &argv[1], 2);
} else if (!strcmp(__glutArgv[i], "-direct")) {
__glutWarning("-direct option only valid for X glut.");
removeArgs(argcp, &argv[1], 1);
} else if (!strcmp(__glutArgv[i], "-indirect")) {
__glutWarning("-indirect option only valid for X glut.");
removeArgs(argcp, &argv[1], 1);
} else if (!strcmp(__glutArgv[i], "-iconic")) {
__glutWarning("-iconic option doesn't make sense in BeOS.");
removeArgs(argcp, &argv[1], 1);
} else if (!strcmp(__glutArgv[i], "-gldebug")) {
gState.debug = true;
removeArgs(argcp, &argv[1], 1);
} else if (!strcmp(__glutArgv[i], "-sync")) {
__glutWarning("-sync option only valid for X glut.");
removeArgs(argcp, &argv[1], 1);
} else {
/* Once unknown option encountered, stop command line
processing. */
break;
}
}
__glutInit(); /* Create BApplication first so DisplayWidth() works */
if (geometry) {
int flags, x, y, width, height;
/* Fix bogus "{width|height} may be used before set"
warning */
width = 0;
height = 0;
flags = XParseGeometry(geometry, &x, &y,
(unsigned int *) &width, (unsigned int *) &height);
if (WidthValue & flags) {
/* Careful because X does not allow zero or negative
width windows */
if (width > 0)
gState.initWidth = width;
}
if (HeightValue & flags) {
/* Careful because X does not allow zero or negative
height windows */
if (height > 0)
gState.initHeight = height;
}
if (XValue & flags) {
if (XNegative & flags)
x = DisplayWidth() + x - gState.initWidth;
/* Play safe: reject negative X locations */
if (x >= 0)
gState.initX = x;
}
if (YValue & flags) {
if (YNegative & flags)
y = DisplayHeight() + y - gState.initHeight;
/* Play safe: reject negative Y locations */
if (y >= 0)
gState.initY = y;
}
}
}
/***********************************************************
* FUNCTION: __glutInit
*
* DESCRIPTION: create BApplication, parse cmd-line arguments,
* and set up gState structure.
***********************************************************/
void __glutInit() {
// open BApplication
gState.display = new BApplication("application/x-glut-demo");
be_app->Unlock();
gState.appthread = spawn_thread(bAppThread, "BApplication", B_NORMAL_PRIORITY, 0);
resume_thread(gState.appthread);
bigtime_t unused;
__glutInitTime(&unused);
/* set atexit() function to destroy all windows before exiting */
if(atexit(__glutDestroyAllWindows))
__glutFatalError("can't set exit handler");
/* similarly, destroy all windows on CTRL-C */
signal(SIGINT, sigHandler);
}
/***********************************************************
* FUNCTION: glutInitWindowPosition (2.2)
*
* DESCRIPTION: set initial window position
***********************************************************/
void glutInitWindowPosition(int x, int y) {
gState.initX = x;
gState.initY = y;
}
/***********************************************************
* FUNCTION: glutInitWindowSize (2.2)
*
* DESCRIPTION: set initial window size
***********************************************************/
void glutInitWindowSize(int width, int height) {
gState.initWidth = width;
gState.initHeight = height;
}
/***********************************************************
* FUNCTION: glutInitDisplayMode (2.3)
*
* DESCRIPTION: set initial display mode
***********************************************************/
void glutInitDisplayMode(unsigned int mode) {
gState.displayMode = mode;
}

View File

@ -1,326 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
* FILE: glutMenu.cpp
*
* DESCRIPTION: code for popup menu handling
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include <stdlib.h>
#include <string.h>
#include "glutint.h"
#include "glutState.h"
/***********************************************************
* Private variables
***********************************************************/
static GlutMenu **menuList = 0;
static int menuListSize = 0;
/***********************************************************
* FUNCTION: getUnusedMenuSlot
*
* DESCRIPTION: helper function to get a new menu slot
***********************************************************/
GlutMenu *__glutGetMenuByNum(int menunum)
{
if (menunum < 1 || menunum > menuListSize) {
return NULL;
}
return menuList[menunum - 1];
}
/***********************************************************
* FUNCTION: getUnusedMenuSlot
*
* DESCRIPTION: helper function to get a new menu slot
***********************************************************/
static int
getUnusedMenuSlot(void)
{
int i;
/* Look for allocated, unused slot. */
for (i = 0; i < menuListSize; i++) {
if (!menuList[i]) {
return i;
}
}
/* Allocate a new slot. */
menuListSize++;
menuList = (GlutMenu **)
realloc(menuList, menuListSize * sizeof(GlutMenu *));
if (!menuList)
__glutFatalError("out of memory.");
menuList[menuListSize - 1] = NULL;
return menuListSize - 1;
}
/***********************************************************
* FUNCTION: glutCreateMenu (6.1)
*
* DESCRIPTION: create a new menu
***********************************************************/
int APIENTRY
glutCreateMenu(GLUTselectCB selectFunc)
{
GlutMenu *menu;
int menuid;
menuid = getUnusedMenuSlot();
menu = new GlutMenu(menuid, selectFunc); // constructor sets up members
menuList[menuid] = menu;
gState.currentMenu = menu;
return menuid + 1;
}
/***********************************************************
* FUNCTION: glutSetMenu (6.2)
* glutGetMenu
*
* DESCRIPTION: set and get the current menu
***********************************************************/
int APIENTRY
glutGetMenu(void)
{
if (gState.currentMenu) {
return gState.currentMenu->id + 1;
} else {
return 0;
}
}
void APIENTRY
glutSetMenu(int menuid)
{
GlutMenu *menu;
if (menuid < 1 || menuid > menuListSize) {
__glutWarning("glutSetMenu attempted on bogus menu.");
return;
}
menu = menuList[menuid - 1];
if (!menu) {
__glutWarning("glutSetMenu attempted on bogus menu.");
return;
}
gState.currentMenu = menu;
}
/***********************************************************
* FUNCTION: glutDestroyMenu (6.3)
*
* DESCRIPTION: destroy the specified menu
***********************************************************/
void APIENTRY
glutDestroyMenu(int menunum)
{
GlutMenu *menu = __glutGetMenuByNum(menunum);
menuList[menunum - 1] = 0;
if (gState.currentMenu == menu) {
gState.currentMenu = 0;
}
delete menu;
}
/***********************************************************
* FUNCTION: glutAddMenuEntry (6.4)
*
* DESCRIPTION: add a new menu item
***********************************************************/
void
glutAddMenuEntry(const char *label, int value)
{
new GlutMenuItem(gState.currentMenu, false, value, label);
}
/***********************************************************
* FUNCTION: glutAddSubMenu (6.5)
*
* DESCRIPTION: add a new submenu
***********************************************************/
void
glutAddSubMenu(const char *label, int menu)
{
new GlutMenuItem(gState.currentMenu, true, menu-1, label);
}
/***********************************************************
* FUNCTION: glutChangeToMenuEntry (6.6)
*
* DESCRIPTION: change menuitem into a menu entry
***********************************************************/
void
glutChangeToMenuEntry(int num, const char *label, int value)
{
GlutMenuItem *item;
int i;
i = gState.currentMenu->num;
item = gState.currentMenu->list;
while (item) {
if (i == num) {
free(item->label);
item->label = strdup(label);
item->isTrigger = false;
item->value = value;
return;
}
i--;
item = item->next;
}
__glutWarning("Current menu has no %d item.", num);
}
/***********************************************************
* FUNCTION: glutChangeToSubMenu (6.7)
*
* DESCRIPTION: change menuitem into a submenu
***********************************************************/
void
glutChangeToSubMenu(int num, const char *label, int menu)
{
GlutMenuItem *item;
int i;
i = gState.currentMenu->num;
item = gState.currentMenu->list;
while (item) {
if (i == num) {
free(item->label);
item->label = strdup(label);
item->isTrigger = true;
item->value = menu-1;
return;
}
i--;
item = item->next;
}
__glutWarning("Current menu has no %d item.", num);
}
/***********************************************************
* FUNCTION: glutRemoveMenuItem (6.8)
*
* DESCRIPTION: remove a menu item
***********************************************************/
void
glutRemoveMenuItem(int num)
{
GlutMenuItem *item, **prev;
int i;
i = gState.currentMenu->num;
prev = &gState.currentMenu->list;
item = gState.currentMenu->list;
while (item) {
if (i == num) {
gState.currentMenu->num--;
/* Patch up menu's item list. */
*prev = item->next;
free(item->label);
delete item;
return;
}
i--;
prev = &item->next;
item = item->next;
}
__glutWarning("Current menu has no %d item.", num);
}
/***********************************************************
* FUNCTION: glutAttachMenu (6.9)
* glutDetachMenu
*
* DESCRIPTION: attach and detach menu from view
***********************************************************/
void
glutAttachMenu(int button)
{
gState.currentWindow->menu[button] = gState.currentMenu->id + 1;
}
void
glutDetachMenu(int button)
{
gState.currentWindow->menu[button] = 0;
}
/***********************************************************
* CLASS: GlutMenu
*
* FUNCTION: CreateBMenu
*
* DESCRIPTION: construct a BPopupMenu for this menu
***********************************************************/
BMenu *GlutMenu::CreateBMenu(bool toplevel) {
BMenu *bpopup;
if(toplevel) {
bpopup = new GlutPopUp(id+1);
} else {
bpopup = new BMenu("");
}
GlutMenuItem *item = list;
while (item) {
GlutBMenuItem *bitem;
if(item->isTrigger) {
// recursively call CreateBMenu
bitem = new GlutBMenuItem(menuList[item->value]->CreateBMenu(false));
bitem->SetLabel(item->label);
bitem->menu = 0; // real menu items start at 1
bitem->value = 0;
} else {
bitem = new GlutBMenuItem(item->label);
bitem->menu = id + 1;
bitem->value = item->value;
}
bpopup->AddItem(bitem, 0);
item = item->next;
}
return bpopup;
}
/***********************************************************
* CLASS: GlutMenu
*
* FUNCTION: (destructor)
*
* DESCRIPTION: destroy the menu and its items (but not submenus!)
***********************************************************/
GlutMenu::~GlutMenu() {
while (list) {
GlutMenuItem *next = list->next;
delete list;
list = next;
}
}
/***********************************************************
* CLASS: GlutMenuItem
*
* FUNCTION: (constructor)
*
* DESCRIPTION: construct the new menu item and add to parent
***********************************************************/
GlutMenuItem::GlutMenuItem(GlutMenu *n_menu, bool n_trig, int n_value, const char *n_label)
{
menu = n_menu;
isTrigger = n_trig;
value = n_value;
label = strdup(n_label);
next = menu->list;
menu->list = this;
menu->num++;
}

View File

@ -1,84 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
* FILE: glutMenu.h
*
* DESCRIPTION: the GlutMenu class is a simple popup menu
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include <Menu.h>
#include <MenuItem.h>
#include <PopUpMenu.h>
/***********************************************************
* Definitions
***********************************************************/
const int32 MENU_ITEM = 'menu';
/***********************************************************
* CLASS: GlutMenu
***********************************************************/
class GlutMenuItem;
class GlutPopUp;
class GlutMenu {
public:
GlutMenu(int n_id, GLUTselectCB n_select) {
id = n_id;
select = n_select;
list = 0;
num = 0;
}
~GlutMenu();
BMenu *CreateBMenu(bool toplevel=true); // construct BPopUpMenu
// public data
int id;
GLUTselectCB select; // callback function
GlutMenuItem *list; // list of menu items
int num; // number of items
};
/***********************************************************
* CLASS: GlutMenuItem
***********************************************************/
class GlutMenuItem {
public:
GlutMenuItem(GlutMenu *n_menu, bool n_trig, int n_value, const char *n_label);
// public data
GlutMenu *menu; // parent menu
bool isTrigger; // are we a submenu?
int value; // value to send, or submenu id if isTrigger
char *label; // strdup'ed label string
GlutMenuItem *next; // next menu entry on list
};
/***********************************************************
* CLASS: GlutPopUp
***********************************************************/
class GlutPopUp : public BPopUpMenu {
public:
GlutPopUp(int m) : BPopUpMenu(0, false, false) { menu = m;}
BPoint point; // point to start menu
GlutWindow *win; // pointer to my window
int menu; // my menu number
};
/***********************************************************
* CLASS: GlutBMenuItem
***********************************************************/
class GlutBMenuItem : public BMenuItem {
public:
GlutBMenuItem(const char *name) : BMenuItem(name, 0) {}
GlutBMenuItem(BMenu* menu) : BMenuItem(menu) {}
int menu, value;
};

View File

@ -1,47 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
*
* FILE: glutOverlay.cpp
*
* DESCRIPTION: we don't support overlays, so this code is
* really simple
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include "glutint.h"
void glutEstablishOverlay() {
__glutFatalError("BeOS lacks overlay support.");
}
void glutUseLayer(GLenum layer) {
// ignore
}
void glutRemoveOverlay() {
// ignore
}
void glutPostOverlayRedisplay() {
// ignore
}
void glutShowOverlay() {
// ignore
}
void glutHideOverlay() {
// ignore
}
void glutPostWindowOverlayRedisplay(int win) {
// ignore
}

View File

@ -1,71 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
*
* FILE: glutState.h
*
* DESCRIPTION: the global state for GLUT
* (takes the place of glutint.h in the C version)
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include <Application.h>
#include "glutWindow.h"
#include "glutMenu.h"
/***********************************************************
* CLASS: GlutState
*
* DESCRIPTION: all the global state variables
***********************************************************/
struct GlutState {
BApplication *display;
thread_id appthread;
int initX, initY; // initial window position
int initWidth, initHeight; // initial window size
unsigned int displayMode; // initial display mode
char *displayString; // verbose display mode
GlutWindow *currentWindow; // current window
GlutMenu *currentMenu; // current menu
GlutWindow **windowList; // array of pointers to windows
int windowListSize; // size of window list
GLUTidleCB idle; // idle callback
GLUTmenuStatusCB menuStatus; // menu status callback
int modifierKeys; // only valid during keyboard callback
bool debug; // call glGetError
bool quitAll; // quit
GlutState() {
display = 0;
appthread = 0;
initX = initY = -1;
initWidth = initHeight = 300;
displayMode = GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH;
displayString = 0;
currentWindow = 0;
currentMenu = 0;
windowList = 0;
windowListSize = 0;
idle = 0;
menuStatus = 0;
modifierKeys = ~0;
debug = quitAll = false;
}
};
/***********************************************************
* Global variable (declared in glutInit.cpp)
***********************************************************/
extern GlutState gState;

View File

@ -1,633 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
*
* FILE: glutWindow.cpp
*
* DESCRIPTION: all the routines for dealing with GlutWindows
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include <stdlib.h>
#include "glutint.h"
#include "glutState.h"
#include "glutBlocker.h"
/***********************************************************
* FUNCTION: getUnusedWindowSlot
*
* DESCRIPTION: helper function to get a new window slot
***********************************************************/
static int
getUnusedWindowSlot()
{
int i;
/* Look for allocated, unused slot. */
for (i = 0; i < gState.windowListSize; i++) {
if (!gState.windowList[i]) {
return i;
}
}
/* Allocate a new slot. */
gState.windowListSize++;
gState.windowList = (GlutWindow **)
realloc(gState.windowList,
gState.windowListSize * sizeof(GlutWindow *));
if (!gState.windowList)
__glutFatalError("out of memory.");
gState.windowList[gState.windowListSize - 1] = NULL;
return gState.windowListSize - 1;
}
/***********************************************************
* FUNCTION: __glutDefaultDisplay
* __glutDefaultReshape
*
* DESCRIPTION: default display and reshape functions
***********************************************************/
static void
__glutDefaultDisplay(void)
{
/* XXX Remove the warning after GLUT 3.0. */
__glutWarning("The following is a new check for GLUT 3.0; update your code.");
__glutFatalError(
"redisplay needed for window %d, but no display callback.",
gState.currentWindow->num + 1);
}
void
__glutDefaultReshape(int width, int height)
{
/* Adjust the viewport of the window */
glViewport(0, 0, (GLsizei) width, (GLsizei) height);
}
/***********************************************************
* CLASS: GlutWindow
*
* FUNCTION: (constructor)
*
* DESCRIPTION: creates a new GLUT window
* note: subwindows don't resize, but top-level windows
* follow all sides
***********************************************************/
GlutWindow::GlutWindow(GlutWindow *nparent, char *name,
int x, int y, int width, int height, ulong options) :
BGLView(
(nparent ? BRect(x,y,x+width-1,y+height-1) :
BRect(0,0,width-1,height-1)), name,
(nparent ? B_FOLLOW_NONE : B_FOLLOW_ALL_SIDES),
B_WILL_DRAW|B_FRAME_EVENTS|B_FULL_UPDATE_ON_RESIZE|B_PULSE_NEEDED,
options)
{
// add myself to window list
num = getUnusedWindowSlot();
gState.windowList[num] = this;
// set up parent/children relationships
parent = nparent;
if (parent) {
siblings = parent->children;
parent->children = this;
} else {
siblings = 0;
}
children = 0;
// initialize variables
cursor = GLUT_CURSOR_INHERIT; // default cursor
for (int i = 0; i < GLUT_MAX_MENUS; i++) {
menu[i] = 0;
}
m_width = width;
m_height = height;
m_buttons = 0;
// clear callbacks
display = __glutDefaultDisplay;
reshape = __glutDefaultReshape;
mouse = 0;
motion = 0;
passive = 0;
entry = 0;
keyboard = 0;
visibility = 0;
special = 0;
windowStatus = 0;
// clear event counters
anyevents = 1;
displayEvent = 1; // get a reshape and a display event right away
reshapeEvent = 1;
mouseEvent = 0;
motionEvent = 0;
passiveEvent = 0;
entryEvent = 0;
keybEvent = 0;
windowStatusEvent = 0; // DirectConnected() will report change in
visState = -1; // visibility
specialEvent = 0;
statusEvent = 0;
menuEvent = 0;
visible = true;
gBlock.QuickNewEvent();
// if i'm a subwindow, add me to my parent view
if (parent) {
parent->Window()->Lock();
parent->AddChild(this);
parent->Window()->Unlock();
} else {
// if I'm a top-level window, create my BWindow
GlutBWindow *mybwindow = new GlutBWindow(
BRect(x,y,x+width-1,y+height-1), name);
mybwindow->AddChild(this);
mybwindow->bgl = this;
mybwindow->Show();
}
// give me the keyboard focus (focus follows mouse, X style, as
// implemented in GlutWindow::MouseMoved())
Window()->Lock();
MakeFocus();
Window()->Unlock();
// make myself the default window
__glutSetWindow(this);
}
/***********************************************************
* FUNCTION: glutCreateWindow (4.1)
*
* DESCRIPTION: creates a new GLUT window
***********************************************************/
int glutCreateWindow(const char *name) {
if (!be_app)
__glutInit();
ulong options;
if (!__glutConvertDisplayMode(&options)) {
__glutWarning("visual with necessary capabilities not found.");
}
// if X or Y is negative, then start at a reasonable position
bool defaultxy = (gState.initX < 0) || (gState.initY < 0);
GlutWindow *window = new GlutWindow(0, const_cast<char*>(name),
(defaultxy ? 50 : gState.initX), (defaultxy ? 50 : gState.initY),
gState.initWidth, gState.initHeight, options);
return window->num + 1;
}
/***********************************************************
* FUNCTION: glutCreateSubWindow (4.2)
*
* DESCRIPTION: creates a new GLUT subwindow
* Note: a subwindow is a GlutWindow (which is actually
* a BGLView) without its own BWindow
***********************************************************/
int glutCreateSubWindow(int win, int x, int y, int width, int height) {
ulong options;
if (!__glutConvertDisplayMode(&options)) {
__glutFatalError("visual with necessary capabilities not found.");
}
GlutWindow *window = new GlutWindow(gState.windowList[win-1], "child",
x, y, width, height, options);
return window->num + 1;
}
/***********************************************************
* FUNCTION: __glutSetWindow
*
* DESCRIPTION: set the current window (utility function)
***********************************************************/
void
__glutSetWindow(GlutWindow * window)
{
if (gState.currentWindow)
gState.currentWindow->UnlockGL();
gState.currentWindow = window;
gState.currentWindow->LockGL();
}
/***********************************************************
* FUNCTION: glutSetWindow (4.3)
* glutGetWindow
*
* DESCRIPTION: set and get the current window
***********************************************************/
void glutSetWindow(int win) {
GlutWindow *window;
if (win < 1 || win > gState.windowListSize) {
__glutWarning("glutSetWindow attempted on bogus window.");
return;
}
window = gState.windowList[win - 1];
if (!window) {
__glutWarning("glutSetWindow attempted on bogus window.");
return;
}
__glutSetWindow(window);
}
int glutGetWindow() {
if (gState.currentWindow) {
return gState.currentWindow->num + 1;
} else {
return 0;
}
}
/***********************************************************
* FUNCTION: __glutDestroyWindow
*
* DESCRIPTION: recursively set entries to 0
***********************************************************/
static void
__glutDestroyWindow(GlutWindow *window, GlutWindow *initialWindow) {
// first, find all children recursively and set their entries to 0
GlutWindow *cur = window->children;
while (cur) {
GlutWindow *siblings = cur->siblings;
__glutDestroyWindow(cur, initialWindow);
cur = siblings;
}
/* Remove from parent's children list (only necessary for
non-initial windows and subwindows!). */
GlutWindow *parent = window->parent;
if (parent && parent == initialWindow->parent) {
GlutWindow **prev = &parent->children;
cur = parent->children;
while (cur) {
if (cur == window) {
*prev = cur->siblings;
break;
}
prev = &(cur->siblings);
cur = cur->siblings;
}
}
// finally, check if we are the current window, and set to 0
if (gState.currentWindow == window) {
gState.currentWindow = 0;
}
gState.windowList[window->num] = 0;
}
/***********************************************************
* FUNCTION: glutDestroyWindow (4.4)
*
* DESCRIPTION: destroy window and all its children
***********************************************************/
void glutDestroyWindow(int win) {
// can't destroy a window if another window has the GL context
if (gState.currentWindow)
gState.currentWindow->UnlockGL();
// lock the window
GlutWindow *window = gState.windowList[win-1];
BWindow *bwindow = window->Window();
bwindow->Lock();
// if win is the current window, set current window to 0
if (gState.currentWindow == window) {
gState.currentWindow = 0;
}
// recursively set child entries to 0
__glutDestroyWindow(window, window);
// try flushing OpenGL
window->LockGL();
glFlush();
window->UnlockGL();
// now, if the window was top-level, delete its BWindow
if(!window->parent) {
bwindow->Quit();
} else {
// else, detach it from the BWindow and delete it
window->RemoveSelf();
delete window;
bwindow->Unlock();
}
// relock GL if the current window is still valid
if(gState.currentWindow)
gState.currentWindow->LockGL();
}
/***********************************************************
* FUNCTION: __glutDestroyAllWindows
*
* DESCRIPTION: destroy all windows when exit() is called
* this seems to be necessary to avoid delays
* and crashes when using BDirectWindow
***********************************************************/
void __glutDestroyAllWindows() {
for(int i=0; i<gState.windowListSize; i++) {
if (gState.windowList[i]) {
glutDestroyWindow(i + 1);
}
}
gState.display->Lock();
gState.display->Quit();
status_t ignored;
wait_for_thread(gState.appthread, &ignored);
}
/***********************************************************
* FUNCTION: glutPostRedisplay (4.5)
*
* DESCRIPTION: mark window as needing redisplay
***********************************************************/
void glutPostRedisplay() {
gState.currentWindow->Window()->Lock();
gState.currentWindow->anyevents = true;
gState.currentWindow->displayEvent = true;
gState.currentWindow->Window()->Unlock();
gBlock.QuickNewEvent();
}
/***********************************************************
* FUNCTION: glutPostWindowRedisplay
*
* DESCRIPTION: mark window as needing redisplay
***********************************************************/
void glutPostWindowRedisplay(int win) {
GlutWindow *gwin = gState.windowList[win - 1];
gwin->Window()->Lock();
gwin->anyevents = true;
gwin->displayEvent = true;
gwin->Window()->Unlock();
gBlock.QuickNewEvent();
}
/***********************************************************
* FUNCTION: glutSwapBuffers (4.6)
*
* DESCRIPTION: swap buffers
***********************************************************/
void glutSwapBuffers() {
gState.currentWindow->SwapBuffers();
}
/***********************************************************
* FUNCTION: glutPositionWindow (4.7)
*
* DESCRIPTION: move window
***********************************************************/
void glutPositionWindow(int x, int y) {
BDirectWindow *win = dynamic_cast<BDirectWindow*>(gState.currentWindow->Window());
win->Lock();
if (gState.currentWindow->parent)
gState.currentWindow->MoveTo(x, y); // move the child view
else {
if(win->IsFullScreen()) {
win->SetFullScreen(false);
}
win->MoveTo(x, y); // move the window
}
win->Unlock();
}
/***********************************************************
* FUNCTION: glutReshapeWindow (4.8)
*
* DESCRIPTION: reshape window (we'll catch the callback
* when the view gets a Draw() message
***********************************************************/
void glutReshapeWindow(int width, int height) {
BDirectWindow *win = dynamic_cast<BDirectWindow*>(gState.currentWindow->Window());
win->Lock();
if (gState.currentWindow->parent)
gState.currentWindow->ResizeTo(width-1, height-1); // resize the child
else {
if(win->IsFullScreen()) {
win->SetFullScreen(false);
}
win->ResizeTo(width-1, height-1); // resize the parent
}
win->Unlock();
}
/***********************************************************
* FUNCTION: glutFullScreen (4.9)
*
* DESCRIPTION: makes the window full screen
***********************************************************/
void glutFullScreen() {
BDirectWindow *win = dynamic_cast<BDirectWindow*>(gState.currentWindow->Window());
win->Lock();
win->SetFullScreen(true);
win->Unlock();
}
/***********************************************************
* FUNCTION: glutPopWindow (4.10)
* glutPushWindow
*
* DESCRIPTION: change the stacking order of the current window
* NOTE: I can't figure out how to do this for windows,
* and there is no concept of "stacking order" for
* subwindows, so these are currently no-ops.
***********************************************************/
void glutPopWindow() { }
void glutPushWindow() { }
/***********************************************************
* FUNCTION: glutShowWindow (4.11)
* glutHideWindow
* glutIconifyWindow
*
* DESCRIPTION: change display status of current window
***********************************************************/
void glutShowWindow() {
gState.currentWindow->Window()->Lock();
if (gState.currentWindow->parent) // subwindow
gState.currentWindow->Show();
else {
if(gState.currentWindow->Window()->IsHidden())
gState.currentWindow->Window()->Show(); // show the actual BWindow
gState.currentWindow->Window()->Minimize(false);
}
gState.currentWindow->Window()->Unlock();
}
void glutHideWindow() {
gState.currentWindow->Window()->Lock();
if (gState.currentWindow->parent) // subwindow
gState.currentWindow->Hide();
else
gState.currentWindow->Window()->Hide(); // show the actual BWindow
gState.currentWindow->Window()->Unlock();
}
void glutIconifyWindow() {
if(gState.currentWindow->parent)
__glutFatalError("can't iconify a subwindow");
gState.currentWindow->Window()->Lock();
gState.currentWindow->Window()->Minimize(true);
gState.currentWindow->Window()->Unlock();
}
/***********************************************************
* FUNCTION: glutSetWindowTitle (4.12)
* glutSetIconTitle
*
* DESCRIPTION: set the window title (icon title is same)
***********************************************************/
void glutSetWindowTitle(const char *name) {
if (gState.currentWindow->parent)
__glutFatalError("glutSetWindowTitle: isn't a top-level window");
gState.currentWindow->Window()->Lock();
gState.currentWindow->Window()->SetTitle(name);
gState.currentWindow->Window()->Unlock();
}
void glutSetIconTitle(const char *name) {
glutSetWindowTitle(name);
}
/***********************************************************
* FUNCTION: __glutConvertDisplayMode
*
* DESCRIPTION: converts the current display mode into a BGLView
* display mode, printing warnings as appropriate.
*
* PARAMETERS: if options is non-NULL, the current display mode is
* returned in it.
*
* RETURNS: 1 if the current display mode is possible, else 0
***********************************************************/
int __glutConvertDisplayMode(unsigned long *options) {
if (gState.displayString) {
/* __glutDisplayString should be NULL except if
glutInitDisplayString has been called to register a
different display string. Calling glutInitDisplayString
means using a string instead of an integer mask determine
the visual to use. This big ugly code is in glutDstr.cpp */
return __glutConvertDisplayModeFromString(options);
}
if(options) {
ulong newoptions = 0;
if(gState.displayMode & GLUT_ACCUM)
newoptions |= BGL_ACCUM;
if(gState.displayMode & GLUT_ALPHA)
newoptions |= BGL_ALPHA;
if(gState.displayMode & GLUT_DEPTH)
newoptions |= BGL_DEPTH;
if(gState.displayMode & GLUT_DOUBLE)
newoptions |= BGL_DOUBLE;
if(gState.displayMode & GLUT_STENCIL)
newoptions |= BGL_STENCIL;
*options = newoptions;
}
if(gState.displayMode & GLUT_INDEX) {
__glutWarning("BeOS doesn't support indexed color");
return 0;
}
if(gState.displayMode & GLUT_MULTISAMPLE) {
return 1; // try to go without multisampling
}
if(gState.displayMode & GLUT_STEREO) {
__glutWarning("BeOS doesn't support stereo windows");
return 0;
}
if(gState.displayMode & GLUT_LUMINANCE) {
__glutWarning("BeOS doesn't support luminance color model");
return 0;
}
return 1; // visual supported
}
/***********************************************************
* CLASS: GlutBWindow
*
* DESCRIPTION: very thin wrapper around BWindow
***********************************************************/
GlutBWindow::GlutBWindow(BRect frame, char *name) :
BDirectWindow(frame, name, B_TITLED_WINDOW, 0) {
fConnectionDisabled = false;
bgl = 0;
SetPulseRate(100000);
if (!SupportsWindowMode()) {
__glutFatalError("video card doesn't support windowed operation");
}
}
void GlutBWindow::DirectConnected( direct_buffer_info *info ) {
bgl->DirectConnected(info);
if(bgl && !fConnectionDisabled) {
bgl->EnableDirectMode(true);
}
int newVisState;
if((info->buffer_state & B_DIRECT_MODE_MASK) == B_DIRECT_START) {
bgl->visible = true;
}
if(!bgl->visible || info->buffer_state == B_DIRECT_STOP)
newVisState = GLUT_HIDDEN;
else {
if (info->clip_list_count == 0)
newVisState = GLUT_FULLY_COVERED;
else if (info->clip_list_count == 1)
newVisState = GLUT_FULLY_RETAINED;
else
newVisState = GLUT_PARTIALLY_RETAINED;
}
if(newVisState != bgl->visState) {
bgl->visState = newVisState;
bgl->anyevents = bgl->windowStatusEvent = true;
gBlock.NewEvent();
}
}
GlutBWindow::~GlutBWindow() {
fConnectionDisabled = true;
if(bgl) {
bgl->EnableDirectMode(false);
}
if(!IsHidden())
Hide();
Sync();
}
bool GlutBWindow::QuitRequested() {
gState.quitAll = true;
gBlock.NewEvent();
return false; // don't quit now, wait for main thread to do it
}
void GlutBWindow::Minimize(bool minimize) {
bgl->visible = !minimize;
BWindow::Minimize(minimize);
}
void GlutBWindow::Hide() {
BWindow::Hide();
bgl->visible = false;
}
void GlutBWindow::Show() {
BWindow::Show();
bgl->visible = true;
}

View File

@ -1,119 +0,0 @@
/***********************************************************
* Copyright (C) 1997, Be Inc. Copyright (C) 1999, Jake Hamby.
*
* 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.
*
*
* FILE: glutWindow.h
*
* DESCRIPTION: the GlutWindow class saves all events for
* handling by main thread
***********************************************************/
/***********************************************************
* Headers
***********************************************************/
#include <GL/glut.h>
#include <Window.h>
#include <GLView.h>
/***********************************************************
* CLASS: GlutWindow
*
* INHERITS FROM: BGLView (NOT BWindow!)
*
* DESCRIPTION: all information needed for windows and
* subwindows (handled as similarly as possible)
***********************************************************/
class GlutWindow : public BGLView {
public:
GlutWindow(GlutWindow *nparent, char *name, int x, int y, int width,
int height, ulong options);
void KeyDown(const char *bytes, int32 numBytes);
void MouseDown(BPoint point);
void MouseMoved(BPoint point, uint32 transit, const BMessage *message);
void FrameResized(float width, float height);
void Draw(BRect updateRect);
void Pulse(); // needed since MouseUp() is broken
void MouseCheck(); // check for button state changes
void ErrorCallback(GLenum errorCode);
static long MenuThread(void *menu);
int num; // window number returned to user
int cursor; // my cursor
#define GLUT_MAX_MENUS 3
int menu[GLUT_MAX_MENUS]; // my popup menus
int m_width, m_height; // the last width and height reported to GLUT
uint32 m_buttons; // the last mouse button state
/* Window relationship state. */
GlutWindow *parent; /* parent window */
GlutWindow *children; /* first child window */
GlutWindow *siblings; /* next sibling */
// leave out buttons and dials callbacks that we don't support
GLUTdisplayCB display; /* redraw */
GLUTreshapeCB reshape; /* resize (width,height) */
GLUTmouseCB mouse; /* mouse (button,state,x,y) */
GLUTmotionCB motion; /* motion (x,y) */
GLUTpassiveCB passive; /* passive motion (x,y) */
GLUTentryCB entry; /* window entry/exit (state) */
GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */
GLUTvisibilityCB visibility; /* visibility */
GLUTspecialCB special; /* special key */
GLUTwindowStatusCB windowStatus; /* window status */
bool anyevents; // were any events received?
bool displayEvent; // call display
bool reshapeEvent; // call reshape
bool mouseEvent; // call mouse
bool motionEvent; // call motion
bool passiveEvent; // call passive
bool entryEvent; // call entry
bool keybEvent; // call keyboard
bool windowStatusEvent; // call visibility
bool specialEvent; // call special
bool statusEvent; // menu status changed
bool menuEvent; // menu selected
int button, mouseState; // for mouse callback
int mouseX, mouseY; // for mouse callback
int motionX, motionY; // for motion callback
int passiveX, passiveY; // for passive callback
int entryState; // for entry callback
unsigned char key; // for keyboard callback
int keyX, keyY; // for keyboard callback
int visState; // for visibility callback
int specialKey; // for special key callback
int specialX, specialY; // for special callback
int modifierKeys; // modifier key state
int menuStatus; // for status callback
int statusX, statusY; // for status callback
int menuNumber; // for menu and status callbacks
int menuValue; // for menu callback
bool visible; // for visibility callback
};
/***********************************************************
* CLASS: GlutBWindow
*
* INHERITS FROM: BDirectWindow
*
* DESCRIPTION: basically a BWindow that won't quit
***********************************************************/
class GlutBWindow : public BDirectWindow {
public:
GlutBWindow(BRect frame, char *name);
~GlutBWindow();
void DirectConnected(direct_buffer_info *info);
bool QuitRequested(); // exits app
void Minimize(bool minimized); // minimized windows are not visible
void Hide();
void Show();
GlutWindow *bgl;
bool fConnectionDisabled;
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,57 +0,0 @@
/* Copyright (c) Mark J. Kilgard, 1994. */
/* 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. */
#include "glutint.h"
#include "glutbitmap.h"
void APIENTRY
glutBitmapCharacter(GLUTbitmapFont font, int c)
{
const BitmapCharRec *ch;
BitmapFontPtr fontinfo;
GLint swapbytes, lsbfirst, rowlength;
GLint skiprows, skippixels, alignment;
#if defined(_WIN32)
fontinfo = (BitmapFontPtr) __glutFont(font);
#else
fontinfo = (BitmapFontPtr) font;
#endif
if (c < fontinfo->first ||
c >= fontinfo->first + fontinfo->num_chars)
return;
ch = fontinfo->ch[c - fontinfo->first];
if (ch) {
/* Save current modes. */
glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes);
glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst);
glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength);
glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows);
glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels);
glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
/* Little endian machines (DEC Alpha for example) could
benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE
instead of GL_FALSE, but this would require changing the
generated bitmaps too. */
glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glBitmap(ch->width, ch->height, ch->xorig, ch->yorig,
ch->advance, 0, ch->bitmap);
/* Restore saved modes. */
glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
}
}

View File

@ -1,58 +0,0 @@
/* Copyright (c) Mark J. Kilgard, 1994. */
/* 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. */
#include "glutint.h"
#include "glutbitmap.h"
/* CENTRY */
int APIENTRY
glutBitmapWidth(GLUTbitmapFont font, int c)
{
BitmapFontPtr fontinfo;
const BitmapCharRec *ch;
#ifdef _WIN32
fontinfo = (BitmapFontPtr) __glutFont(font);
#else
fontinfo = (BitmapFontPtr) font;
#endif
if (c < fontinfo->first || c >= fontinfo->first + fontinfo->num_chars)
return 0;
ch = fontinfo->ch[c - fontinfo->first];
if (ch)
return ch->advance;
else
return 0;
}
int APIENTRY
glutBitmapLength(GLUTbitmapFont font, const unsigned char *string)
{
int c, length;
BitmapFontPtr fontinfo;
const BitmapCharRec *ch;
#ifdef _WIN32
fontinfo = (BitmapFontPtr) __glutFont(font);
#else
fontinfo = (BitmapFontPtr) font;
#endif
length = 0;
for (; *string != '\0'; string++) {
c = *string;
if (c >= fontinfo->first && c < fontinfo->first + fontinfo->num_chars) {
ch = fontinfo->ch[c - fontinfo->first];
if (ch)
length += ch->advance;
}
}
return length;
}
/* ENDCENTRY */

View File

@ -1,201 +0,0 @@
/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
/* 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. */
#include <stdlib.h>
#include <string.h>
#include "glutint.h"
/* CENTRY */
int GLUTAPIENTRY
glutExtensionSupported(const char *extension)
{
static const GLubyte *extensions = NULL;
const GLubyte *start;
GLubyte *where, *terminator;
/* Extension names should not have spaces. */
where = (GLubyte *) strchr(extension, ' ');
if (where || *extension == '\0')
return 0;
if (!extensions) {
extensions = glGetString(GL_EXTENSIONS);
}
/* It takes a bit of care to be fool-proof about parsing the
OpenGL extensions string. Don't be fooled by sub-strings,
etc. */
start = extensions;
for (;;) {
/* If your application crashes in the strstr routine below,
you are probably calling glutExtensionSupported without
having a current window. Calling glGetString without
a current OpenGL context has unpredictable results.
Please fix your program. */
where = (GLubyte *) strstr((const char *) start, extension);
if (!where)
break;
terminator = where + strlen(extension);
if (where == start || *(where - 1) == ' ') {
if (*terminator == ' ' || *terminator == '\0') {
return 1;
}
}
start = terminator;
}
return 0;
}
struct name_address_pair {
const char *name;
const GLUTproc address;
};
static struct name_address_pair glut_functions[] = {
{ "glutInit", (const GLUTproc) glutInit },
{ "glutInitDisplayMode", (const GLUTproc) glutInitDisplayMode },
{ "glutInitDisplayString", (const GLUTproc) glutInitDisplayString },
{ "glutInitWindowPosition", (const GLUTproc) glutInitWindowPosition },
{ "glutInitWindowSize", (const GLUTproc) glutInitWindowSize },
{ "glutMainLoop", (const GLUTproc) glutMainLoop },
{ "glutCreateWindow", (const GLUTproc) glutCreateWindow },
{ "glutCreateSubWindow", (const GLUTproc) glutCreateSubWindow },
{ "glutDestroyWindow", (const GLUTproc) glutDestroyWindow },
{ "glutPostRedisplay", (const GLUTproc) glutPostRedisplay },
{ "glutPostWindowRedisplay", (const GLUTproc) glutPostWindowRedisplay },
{ "glutSwapBuffers", (const GLUTproc) glutSwapBuffers },
{ "glutGetWindow", (const GLUTproc) glutGetWindow },
{ "glutSetWindow", (const GLUTproc) glutSetWindow },
{ "glutSetWindowTitle", (const GLUTproc) glutSetWindowTitle },
{ "glutSetIconTitle", (const GLUTproc) glutSetIconTitle },
{ "glutPositionWindow", (const GLUTproc) glutPositionWindow },
{ "glutReshapeWindow", (const GLUTproc) glutReshapeWindow },
{ "glutPopWindow", (const GLUTproc) glutPopWindow },
{ "glutPushWindow", (const GLUTproc) glutPushWindow },
{ "glutIconifyWindow", (const GLUTproc) glutIconifyWindow },
{ "glutShowWindow", (const GLUTproc) glutShowWindow },
{ "glutHideWindow", (const GLUTproc) glutHideWindow },
{ "glutFullScreen", (const GLUTproc) glutFullScreen },
{ "glutSetCursor", (const GLUTproc) glutSetCursor },
{ "glutWarpPointer", (const GLUTproc) glutWarpPointer },
{ "glutEstablishOverlay", (const GLUTproc) glutEstablishOverlay },
{ "glutRemoveOverlay", (const GLUTproc) glutRemoveOverlay },
{ "glutUseLayer", (const GLUTproc) glutUseLayer },
{ "glutPostOverlayRedisplay", (const GLUTproc) glutPostOverlayRedisplay },
{ "glutPostWindowOverlayRedisplay", (const GLUTproc) glutPostWindowOverlayRedisplay },
{ "glutShowOverlay", (const GLUTproc) glutShowOverlay },
{ "glutHideOverlay", (const GLUTproc) glutHideOverlay },
{ "glutCreateMenu", (const GLUTproc) glutCreateMenu },
{ "glutDestroyMenu", (const GLUTproc) glutDestroyMenu },
{ "glutGetMenu", (const GLUTproc) glutGetMenu },
{ "glutSetMenu", (const GLUTproc) glutSetMenu },
{ "glutAddMenuEntry", (const GLUTproc) glutAddMenuEntry },
{ "glutAddSubMenu", (const GLUTproc) glutAddSubMenu },
{ "glutChangeToMenuEntry", (const GLUTproc) glutChangeToMenuEntry },
{ "glutChangeToSubMenu", (const GLUTproc) glutChangeToSubMenu },
{ "glutRemoveMenuItem", (const GLUTproc) glutRemoveMenuItem },
{ "glutAttachMenu", (const GLUTproc) glutAttachMenu },
{ "glutDetachMenu", (const GLUTproc) glutDetachMenu },
{ "glutDisplayFunc", (const GLUTproc) glutDisplayFunc },
{ "glutReshapeFunc", (const GLUTproc) glutReshapeFunc },
{ "glutKeyboardFunc", (const GLUTproc) glutKeyboardFunc },
{ "glutMouseFunc", (const GLUTproc) glutMouseFunc },
{ "glutMotionFunc", (const GLUTproc) glutMotionFunc },
{ "glutPassiveMotionFunc", (const GLUTproc) glutPassiveMotionFunc },
{ "glutEntryFunc", (const GLUTproc) glutEntryFunc },
{ "glutVisibilityFunc", (const GLUTproc) glutVisibilityFunc },
{ "glutIdleFunc", (const GLUTproc) glutIdleFunc },
{ "glutTimerFunc", (const GLUTproc) glutTimerFunc },
{ "glutMenuStateFunc", (const GLUTproc) glutMenuStateFunc },
{ "glutSpecialFunc", (const GLUTproc) glutSpecialFunc },
{ "glutSpaceballMotionFunc", (const GLUTproc) glutSpaceballMotionFunc },
{ "glutSpaceballRotateFunc", (const GLUTproc) glutSpaceballRotateFunc },
{ "glutSpaceballButtonFunc", (const GLUTproc) glutSpaceballButtonFunc },
{ "glutButtonBoxFunc", (const GLUTproc) glutButtonBoxFunc },
{ "glutDialsFunc", (const GLUTproc) glutDialsFunc },
{ "glutTabletMotionFunc", (const GLUTproc) glutTabletMotionFunc },
{ "glutTabletButtonFunc", (const GLUTproc) glutTabletButtonFunc },
{ "glutMenuStatusFunc", (const GLUTproc) glutMenuStatusFunc },
{ "glutOverlayDisplayFunc", (const GLUTproc) glutOverlayDisplayFunc },
{ "glutWindowStatusFunc", (const GLUTproc) glutWindowStatusFunc },
// { "glutKeyboardUpFunc", (const GLUTproc) glutKeyboardUpFunc },
// { "glutSpecialUpFunc", (const GLUTproc) glutSpecialUpFunc },
// { "glutJoystickFunc", (const GLUTproc) glutJoystickFunc },
{ "glutSetColor", (const GLUTproc) glutSetColor },
{ "glutGetColor", (const GLUTproc) glutGetColor },
{ "glutCopyColormap", (const GLUTproc) glutCopyColormap },
{ "glutGet", (const GLUTproc) glutGet },
{ "glutDeviceGet", (const GLUTproc) glutDeviceGet },
{ "glutExtensionSupported", (const GLUTproc) glutExtensionSupported },
{ "glutGetModifiers", (const GLUTproc) glutGetModifiers },
{ "glutLayerGet", (const GLUTproc) glutLayerGet },
{ "glutGetProcAddress", (const GLUTproc) glutGetProcAddress },
{ "glutBitmapCharacter", (const GLUTproc) glutBitmapCharacter },
{ "glutBitmapWidth", (const GLUTproc) glutBitmapWidth },
{ "glutStrokeCharacter", (const GLUTproc) glutStrokeCharacter },
{ "glutStrokeWidth", (const GLUTproc) glutStrokeWidth },
{ "glutBitmapLength", (const GLUTproc) glutBitmapLength },
{ "glutStrokeLength", (const GLUTproc) glutStrokeLength },
{ "glutWireSphere", (const GLUTproc) glutWireSphere },
{ "glutSolidSphere", (const GLUTproc) glutSolidSphere },
{ "glutWireCone", (const GLUTproc) glutWireCone },
{ "glutSolidCone", (const GLUTproc) glutSolidCone },
{ "glutWireCube", (const GLUTproc) glutWireCube },
{ "glutSolidCube", (const GLUTproc) glutSolidCube },
{ "glutWireTorus", (const GLUTproc) glutWireTorus },
{ "glutSolidTorus", (const GLUTproc) glutSolidTorus },
{ "glutWireDodecahedron", (const GLUTproc) glutWireDodecahedron },
{ "glutSolidDodecahedron", (const GLUTproc) glutSolidDodecahedron },
{ "glutWireTeapot", (const GLUTproc) glutWireTeapot },
{ "glutSolidTeapot", (const GLUTproc) glutSolidTeapot },
{ "glutWireOctahedron", (const GLUTproc) glutWireOctahedron },
{ "glutSolidOctahedron", (const GLUTproc) glutSolidOctahedron },
{ "glutWireTetrahedron", (const GLUTproc) glutWireTetrahedron },
{ "glutSolidTetrahedron", (const GLUTproc) glutSolidTetrahedron },
{ "glutWireIcosahedron", (const GLUTproc) glutWireIcosahedron },
{ "glutSolidIcosahedron", (const GLUTproc) glutSolidIcosahedron },
{ "glutVideoResizeGet", (const GLUTproc) glutVideoResizeGet },
{ "glutSetupVideoResizing", (const GLUTproc) glutSetupVideoResizing },
{ "glutStopVideoResizing", (const GLUTproc) glutStopVideoResizing },
{ "glutVideoResize", (const GLUTproc) glutVideoResize },
{ "glutVideoPan", (const GLUTproc) glutVideoPan },
{ "glutReportErrors", (const GLUTproc) glutReportErrors },
// { "glutIgnoreKeyRepeat", (const GLUTproc) glutIgnoreKeyRepeat },
// { "glutSetKeyRepeat", (const GLUTproc) glutSetKeyRepeat },
// { "glutForceJoystickFunc", (const GLUTproc) glutForceJoystickFunc },
// { "glutGameModeString", (const GLUTproc) glutGameModeString },
// { "glutEnterGameMode", (const GLUTproc) glutEnterGameMode },
// { "glutLeaveGameMode", (const GLUTproc) glutLeaveGameMode },
// { "glutGameModeGet", (const GLUTproc) glutGameModeGet },
{ NULL, NULL }
};
/* XXX This isn't an official GLUT function, yet */
GLUTproc GLUTAPIENTRY
glutGetProcAddress(const char *procName)
{
/* Try GLUT functions first */
int i;
for (i = 0; glut_functions[i].name; i++) {
if (strcmp(glut_functions[i].name, procName) == 0)
return glut_functions[i].address;
}
/* Try core GL functions */
#if defined(_WIN32)
return (GLUTProc) wglGetProcAddress((LPCSTR) procName);
#elif defined(GLX_ARB_get_proc_address)
return (GLUTProc) glXGetProcAddressARB((const GLubyte *) procName);
#else
return NULL;
#endif
}
/* ENDCENTRY */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,596 +0,0 @@
/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
/**
(c) Copyright 1993, Silicon Graphics, Inc.
ALL RIGHTS RESERVED
Permission to use, copy, modify, and distribute this software
for any purpose and without fee is hereby granted, provided
that the above copyright notice appear in all copies and that
both the copyright notice and this permission notice appear in
supporting documentation, and that the name of Silicon
Graphics, Inc. not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission.
THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU
"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR
OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO
EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE
ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER,
INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE,
SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR
NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY
OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR
PERFORMANCE OF THIS SOFTWARE.
US Government Users Restricted Rights
Use, duplication, or disclosure by the Government is subject to
restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
(c)(1)(ii) of the Rights in Technical Data and Computer
Software clause at DFARS 252.227-7013 and/or in similar or
successor clauses in the FAR or the DOD or NASA FAR
Supplement. Unpublished-- rights reserved under the copyright
laws of the United States. Contractor/manufacturer is Silicon
Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA
94039-7311.
OpenGL(TM) is a trademark of Silicon Graphics, Inc.
*/
#include <math.h>
#include "glutint.h"
/* Some <math.h> files do not define M_PI... */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
static GLUquadricObj *quadObj;
#define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); }
static void
initQuadObj(void)
{
quadObj = gluNewQuadric();
if (!quadObj)
__glutFatalError("out of memory.");
}
/* CENTRY */
void APIENTRY
glutWireSphere(GLdouble radius, GLint slices, GLint stacks)
{
QUAD_OBJ_INIT();
gluQuadricDrawStyle(quadObj, GLU_LINE);
gluQuadricNormals(quadObj, GLU_SMOOTH);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluSphere(quadObj, radius, slices, stacks);
}
void APIENTRY
glutSolidSphere(GLdouble radius, GLint slices, GLint stacks)
{
QUAD_OBJ_INIT();
gluQuadricDrawStyle(quadObj, GLU_FILL);
gluQuadricNormals(quadObj, GLU_SMOOTH);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluSphere(quadObj, radius, slices, stacks);
}
void APIENTRY
glutWireCone(GLdouble base, GLdouble height,
GLint slices, GLint stacks)
{
QUAD_OBJ_INIT();
gluQuadricDrawStyle(quadObj, GLU_LINE);
gluQuadricNormals(quadObj, GLU_SMOOTH);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluCylinder(quadObj, base, 0.0, height, slices, stacks);
}
void APIENTRY
glutSolidCone(GLdouble base, GLdouble height,
GLint slices, GLint stacks)
{
QUAD_OBJ_INIT();
gluQuadricDrawStyle(quadObj, GLU_FILL);
gluQuadricNormals(quadObj, GLU_SMOOTH);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluCylinder(quadObj, base, 0.0, height, slices, stacks);
}
/* ENDCENTRY */
static void
drawBox(GLfloat size, GLenum type)
{
static GLfloat n[6][3] =
{
{-1.0, 0.0, 0.0},
{0.0, 1.0, 0.0},
{1.0, 0.0, 0.0},
{0.0, -1.0, 0.0},
{0.0, 0.0, 1.0},
{0.0, 0.0, -1.0}
};
static GLint faces[6][4] =
{
{0, 1, 2, 3},
{3, 2, 6, 7},
{7, 6, 5, 4},
{4, 5, 1, 0},
{5, 6, 2, 1},
{7, 4, 0, 3}
};
GLfloat v[8][3];
GLint i;
v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2;
v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2;
v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2;
v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2;
v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2;
v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2;
for (i = 5; i >= 0; i--) {
glBegin(type);
glNormal3fv(&n[i][0]);
glVertex3fv(&v[faces[i][0]][0]);
glVertex3fv(&v[faces[i][1]][0]);
glVertex3fv(&v[faces[i][2]][0]);
glVertex3fv(&v[faces[i][3]][0]);
glEnd();
}
}
/* CENTRY */
void APIENTRY
glutWireCube(GLdouble size)
{
drawBox(size, GL_LINE_LOOP);
}
void APIENTRY
glutSolidCube(GLdouble size)
{
drawBox(size, GL_QUADS);
}
/* ENDCENTRY */
static void
doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings)
{
int i, j;
GLfloat theta, phi, theta1;
GLfloat cosTheta, sinTheta;
GLfloat cosTheta1, sinTheta1;
GLfloat ringDelta, sideDelta;
ringDelta = 2.0 * M_PI / rings;
sideDelta = 2.0 * M_PI / nsides;
theta = 0.0;
cosTheta = 1.0;
sinTheta = 0.0;
for (i = rings - 1; i >= 0; i--) {
theta1 = theta + ringDelta;
cosTheta1 = cos(theta1);
sinTheta1 = sin(theta1);
glBegin(GL_QUAD_STRIP);
phi = 0.0;
for (j = nsides; j >= 0; j--) {
GLfloat cosPhi, sinPhi, dist;
phi += sideDelta;
cosPhi = cos(phi);
sinPhi = sin(phi);
dist = R + r * cosPhi;
glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi);
}
glEnd();
theta = theta1;
cosTheta = cosTheta1;
sinTheta = sinTheta1;
}
}
/* CENTRY */
void APIENTRY
glutWireTorus(GLdouble innerRadius, GLdouble outerRadius,
GLint nsides, GLint rings)
{
glPushAttrib(GL_POLYGON_BIT);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
doughnut(innerRadius, outerRadius, nsides, rings);
glPopAttrib();
}
void APIENTRY
glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius,
GLint nsides, GLint rings)
{
doughnut(innerRadius, outerRadius, nsides, rings);
}
/* ENDCENTRY */
static GLfloat dodec[20][3];
static void
initDodecahedron(void)
{
GLfloat alpha, beta;
alpha = sqrt(2.0 / (3.0 + sqrt(5.0)));
beta = 1.0 + sqrt(6.0 / (3.0 + sqrt(5.0)) -
2.0 + 2.0 * sqrt(2.0 / (3.0 + sqrt(5.0))));
/* *INDENT-OFF* */
dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta;
dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta;
dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1;
dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1;
dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1;
dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1;
dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1;
dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1;
dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1;
dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1;
dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0;
dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0;
dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0;
dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0;
dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta;
dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta;
dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha;
dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha;
dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha;
dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha;
/* *INDENT-ON* */
}
#define DIFF3(_a,_b,_c) { \
(_c)[0] = (_a)[0] - (_b)[0]; \
(_c)[1] = (_a)[1] - (_b)[1]; \
(_c)[2] = (_a)[2] - (_b)[2]; \
}
static void
crossprod(GLfloat v1[3], GLfloat v2[3], GLfloat prod[3])
{
GLfloat p[3]; /* in case prod == v1 or v2 */
p[0] = v1[1] * v2[2] - v2[1] * v1[2];
p[1] = v1[2] * v2[0] - v2[2] * v1[0];
p[2] = v1[0] * v2[1] - v2[0] * v1[1];
prod[0] = p[0];
prod[1] = p[1];
prod[2] = p[2];
}
static void
normalize(GLfloat v[3])
{
GLfloat d;
d = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
if (d == 0.0) {
__glutWarning("normalize: zero length vector");
v[0] = d = 1.0;
}
d = 1 / d;
v[0] *= d;
v[1] *= d;
v[2] *= d;
}
static void
pentagon(int a, int b, int c, int d, int e, GLenum shadeType)
{
GLfloat n0[3], d1[3], d2[3];
DIFF3(dodec[a], dodec[b], d1);
DIFF3(dodec[b], dodec[c], d2);
crossprod(d1, d2, n0);
normalize(n0);
glBegin(shadeType);
glNormal3fv(n0);
glVertex3fv(&dodec[a][0]);
glVertex3fv(&dodec[b][0]);
glVertex3fv(&dodec[c][0]);
glVertex3fv(&dodec[d][0]);
glVertex3fv(&dodec[e][0]);
glEnd();
}
static void
dodecahedron(GLenum type)
{
static int inited = 0;
if (inited == 0) {
inited = 1;
initDodecahedron();
}
pentagon(0, 1, 9, 16, 5, type);
pentagon(1, 0, 3, 18, 7, type);
pentagon(1, 7, 11, 10, 9, type);
pentagon(11, 7, 18, 19, 6, type);
pentagon(8, 17, 16, 9, 10, type);
pentagon(2, 14, 15, 6, 19, type);
pentagon(2, 13, 12, 4, 14, type);
pentagon(2, 19, 18, 3, 13, type);
pentagon(3, 0, 5, 12, 13, type);
pentagon(6, 15, 8, 10, 11, type);
pentagon(4, 17, 8, 15, 14, type);
pentagon(4, 12, 5, 16, 17, type);
}
/* CENTRY */
void APIENTRY
glutWireDodecahedron(void)
{
dodecahedron(GL_LINE_LOOP);
}
void APIENTRY
glutSolidDodecahedron(void)
{
dodecahedron(GL_TRIANGLE_FAN);
}
/* ENDCENTRY */
static void
recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3,
GLenum shadeType)
{
GLfloat q0[3], q1[3];
DIFF3(n1, n2, q0);
DIFF3(n2, n3, q1);
crossprod(q0, q1, q1);
normalize(q1);
glBegin(shadeType);
glNormal3fv(q1);
glVertex3fv(n1);
glVertex3fv(n2);
glVertex3fv(n3);
glEnd();
}
static void
subdivide(GLfloat * v0, GLfloat * v1, GLfloat * v2,
GLenum shadeType)
{
int depth;
GLfloat w0[3], w1[3], w2[3];
GLfloat l;
int i, j, k, n;
depth = 1;
for (i = 0; i < depth; i++) {
for (j = 0; i + j < depth; j++) {
k = depth - i - j;
for (n = 0; n < 3; n++) {
w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth;
w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n])
/ depth;
w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n])
/ depth;
}
l = sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]);
w0[0] /= l;
w0[1] /= l;
w0[2] /= l;
l = sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]);
w1[0] /= l;
w1[1] /= l;
w1[2] /= l;
l = sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]);
w2[0] /= l;
w2[1] /= l;
w2[2] /= l;
recorditem(w1, w0, w2, shadeType);
}
}
}
static void
drawtriangle(int i, GLfloat data[][3], int ndx[][3],
GLenum shadeType)
{
GLfloat *x0, *x1, *x2;
x0 = data[ndx[i][0]];
x1 = data[ndx[i][1]];
x2 = data[ndx[i][2]];
subdivide(x0, x1, x2, shadeType);
}
/* octahedron data: The octahedron produced is centered at the
origin and has radius 1.0 */
static GLfloat odata[6][3] =
{
{1.0, 0.0, 0.0},
{-1.0, 0.0, 0.0},
{0.0, 1.0, 0.0},
{0.0, -1.0, 0.0},
{0.0, 0.0, 1.0},
{0.0, 0.0, -1.0}
};
static int ondex[8][3] =
{
{0, 4, 2},
{1, 2, 4},
{0, 3, 4},
{1, 4, 3},
{0, 2, 5},
{1, 5, 2},
{0, 5, 3},
{1, 3, 5}
};
static void
octahedron(GLenum shadeType)
{
int i;
for (i = 7; i >= 0; i--) {
drawtriangle(i, odata, ondex, shadeType);
}
}
/* CENTRY */
void APIENTRY
glutWireOctahedron(void)
{
octahedron(GL_LINE_LOOP);
}
void APIENTRY
glutSolidOctahedron(void)
{
octahedron(GL_TRIANGLES);
}
/* ENDCENTRY */
/* icosahedron data: These numbers are rigged to make an
icosahedron of radius 1.0 */
#define X .525731112119133606
#define Z .850650808352039932
static GLfloat idata[12][3] =
{
{-X, 0, Z},
{X, 0, Z},
{-X, 0, -Z},
{X, 0, -Z},
{0, Z, X},
{0, Z, -X},
{0, -Z, X},
{0, -Z, -X},
{Z, X, 0},
{-Z, X, 0},
{Z, -X, 0},
{-Z, -X, 0}
};
static int index[20][3] =
{
{0, 4, 1},
{0, 9, 4},
{9, 5, 4},
{4, 5, 8},
{4, 8, 1},
{8, 10, 1},
{8, 3, 10},
{5, 3, 8},
{5, 2, 3},
{2, 7, 3},
{7, 10, 3},
{7, 6, 10},
{7, 11, 6},
{11, 0, 6},
{0, 1, 6},
{6, 1, 10},
{9, 0, 11},
{9, 11, 2},
{9, 2, 5},
{7, 2, 11},
};
static void
icosahedron(GLenum shadeType)
{
int i;
for (i = 19; i >= 0; i--) {
drawtriangle(i, idata, index, shadeType);
}
}
/* CENTRY */
void APIENTRY
glutWireIcosahedron(void)
{
icosahedron(GL_LINE_LOOP);
}
void APIENTRY
glutSolidIcosahedron(void)
{
icosahedron(GL_TRIANGLES);
}
/* ENDCENTRY */
/* tetrahedron data: */
#define T 1.73205080756887729
static GLfloat tdata[4][3] =
{
{T, T, T},
{T, -T, -T},
{-T, T, -T},
{-T, -T, T}
};
static int tndex[4][3] =
{
{0, 1, 3},
{2, 1, 0},
{3, 2, 0},
{1, 2, 3}
};
static void
tetrahedron(GLenum shadeType)
{
int i;
for (i = 3; i >= 0; i--)
drawtriangle(i, tdata, tndex, shadeType);
}
/* CENTRY */
void APIENTRY
glutWireTetrahedron(void)
{
tetrahedron(GL_LINE_LOOP);
}
void APIENTRY
glutSolidTetrahedron(void)
{
tetrahedron(GL_TRIANGLES);
}
/* ENDCENTRY */

Some files were not shown because too many files have changed in this diff Show More