Import of glclock.

glclock is an opengl demo with benchmarking capability.  It
displays clocks with different textures etc.  You will need
a very fast cpu or a hardware accelerated 3d card
(www.freebsd.org/~3d).

PR:		13866
Submitted by:	Randall Hopper <aa8vb@ipass.net>
This commit is contained in:
Chris Piazza 1999-09-25 22:29:13 +00:00
parent 4d9ec0c97c
commit 11955664a7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=21953
7 changed files with 136 additions and 0 deletions

View File

@ -0,0 +1,39 @@
# New ports collection makefile for: glclock
# Version required: 5.0
# Date created: 20 September 1999
# Whom: Randall Hopper <aa8vb@ipass.net>
#
# $FreeBSD$
#
DISTNAME= glclock-5.0
CATEGORIES= x11-clocks
MASTER_SITES= http://www.daionet.gr.jp/~masa/archives/ \
http://hp.vector.co.jp/authors/VA013133/archives/ \
http://www.demonews.com/hosted/masa/archives/
MAINTAINER= aa8vb@ipass.net
LIB_DEPENDS= GL.14:${PORTSDIR}/graphics/Mesa3
USE_X_PREFIX= yes
MAKEFILE= makefile
ALL_TARGET= glclock
SCRIPTS = benchclock crystalclock f_crystalclock f_glclock \
f_marbleclock f_metalclock f_mwclock f_woodclock marbleclock \
metalclock mwclock woodclock
TEXTURES = marble.ppm sky.ppm wood.ppm
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/glclock ${PREFIX}/bin
@for f in ${SCRIPTS}; do \
${INSTALL_SCRIPT} ${WRKSRC}/$$f ${PREFIX}/bin; \
done
@mkdir -p ${PREFIX}/lib/X11/glclock
@for f in ${TEXTURES}; do \
${INSTALL_DATA} ${WRKSRC}/$$f ${PREFIX}/lib/X11/glclock; \
done
.include <bsd.port.mk>

View File

@ -0,0 +1 @@
MD5 (glclock-5.0.tar.gz) = 191938e1fb9fc1105eaf29e8e7dd954f

View File

@ -0,0 +1,37 @@
--- makefile.orig Sat Jun 12 08:37:05 1999
+++ makefile Sat Sep 25 15:23:49 1999
@@ -3,22 +3,27 @@
# June 1998 by Masaki Kawase (g93088@isc.chubu.ac.jp)
#
- CC = g++
- LN = g++
- OPT = -O2
+ CC = ${CXX}
+ LN = ${CC}
+ OPT = ${CFLAGS} -fexpensive-optimizations -ffast-math \
+ -fomit-frame-pointer -fforce-mem -fforce-addr
- INCLUDE_PATH = -I/usr/local/X11R6/include
- LIB_PATH = -L/usr/local/X11R6/lib
+ GLCLOCK_DIR = ${PREFIX}/lib/X11/glclock/
+ INCLUDE_PATH = -I${X11BASE}/include
+ LIB_PATH = -L${X11BASE}/lib -Wl,-rpath,/usr/X11R6/lib
+
+# Link with -lGL on FreeBSD so we use hardware-accelerated GL, when installed.
+# (see http://www.freebsd.org/~3d)
LIBS = -lglut -lGLU -lGL -lXext -lXmu -lX11 -lm
# for Mesa
# LIBS = -lglut -lMesatk -lMesaGLU -lMesaGL -lXi -lXext -lXmu -lX11 -lm
- CFLAGS = -c
+ CFLAGS += -w -DGLCLOCK_DIR=\"${GLCLOCK_DIR}\"
LFLAGS =
-COMPILE = $(CC) $(CFLAGS) $(OPT) $(INCLUDE_PATH)
+COMPILE = $(CC) $(CFLAGS) $(OPT) -c $(INCLUDE_PATH)
LINK = $(LN) $(LFLAGS) $(OPT) $(LIB_PATH)
MAIN = glclock

View File

@ -0,0 +1,38 @@
--- ORIG/glclock.cpp Wed Aug 4 16:28:02 1999
+++ glclock.cpp Mon Sep 20 20:06:09 1999
@@ -5716,7 +5716,10 @@
o_tick = n_tick ;
if ((n_tick = glutGet((GLenum)GLUT_ELAPSED_TIME)))
- fps = f_cnt / ((float)(n_tick - o_tick) / 1000) ;
+ if ( n_tick == o_tick )
+ fps = 0.0f;
+ else
+ fps = f_cnt / ((float)(n_tick - o_tick) / 1000) ;
else
fps = 0.0f ;
@@ -5768,7 +5771,8 @@
{
if (fps_count)
{
- spin_x = -360.0f / fps ;
+ if (fps) spin_x = -360.0f / fps ;
+ else spin_x = -30.0f;
if (spin_x < -30.0f) spin_x = -30.0f ;
}
@@ -7098,6 +7102,13 @@
if (!env_file.Search(".ppm")) env_file += ".ppm" ;
if (!solid_file.Search(".ppm")) solid_file += ".ppm" ;
if (sld2_file != String("") && !sld2_file.Search(".ppm")) sld2_file += ".ppm" ;
+
+ if ( env_file.Length() && env_file.Character(0) != '/' ) \
+ env_file = String( GLCLOCK_DIR ) + env_file;
+ if ( solid_file.Length() && solid_file.Character(0) != '/' ) \
+ solid_file = String( GLCLOCK_DIR ) + solid_file;
+ if ( sld2_file.Length() && sld2_file.Character(0) != '/' ) \
+ sld2_file = String( GLCLOCK_DIR ) + sld2_file;
// 環境マッピングを使用する場合は、メッシュの座標値を多少変更

View File

@ -0,0 +1 @@
OpenGL Spinning pocketwatch demo and benchmark utility

View File

@ -0,0 +1,3 @@
glclock is a OpenGL demo with benchmarking capability. For fun and
performance testing, glclock will be of some use for those who have
hardware-accelerated 3D cards (see www.freebsd.org/~3d) or very fast CPUs.

View File

@ -0,0 +1,17 @@
bin/benchclock
bin/crystalclock
bin/f_crystalclock
bin/f_glclock
bin/f_marbleclock
bin/f_metalclock
bin/f_mwclock
bin/f_woodclock
bin/glclock
bin/marbleclock
bin/metalclock
bin/mwclock
bin/woodclock
lib/X11/glclock/marble.ppm
lib/X11/glclock/sky.ppm
lib/X11/glclock/wood.ppm
@dirrm lib/X11/glclock