Update of /cvsroot/plib/plib/examples/src/ssg/viewer
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11850
Modified Files:
Makefile.am
Added Files:
pview.cxx
Log Message:
added improved viewer example
--- NEW FILE: pview.cxx ---
/*
PLIB - A Suite of Portable Game Libraries
Copyright (C) 2001 Steve Baker
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
For further information visit http://plib.sourceforge.net
[...146 lines suppressed...]
context->makeCurrent();
sgVec3 off;
sgZeroVec3(off);
sgSubVec3(off, scene->getBSphere()->getCenter());
trf->setTransform(off);
SGfloat radius = scene->getBSphere()->getRadius();
float d = 1.8*radius;
if (d<0.5) d=0.5; // avoid placing near-plane beyond model
sgMakeTransMat4(camtrf, 0, -d, 0);
ssgLight *light=ssgGetLight(0);
light->setColour(GL_AMBIENT,0,0,0);
light->setPosition(0,0,radius);
light->on();
glutMainLoop();
}
Index: Makefile.am
===================================================================
RCS file: /cvsroot/plib/plib/examples/src/ssg/viewer/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Makefile.am 1 Sep 2002 05:22:26 -0000 1.7
+++ Makefile.am 21 Aug 2005 08:47:14 -0000 1.8
@@ -1,12 +1,16 @@
if BUILD_SSG
-noinst_PROGRAMS = viewer
+noinst_PROGRAMS = viewer pview
viewer_SOURCES = viewer.cxx
+pview_SOURCES = pview.cxx
+
viewer_LDADD = -lplibssg -lplibpu -lplibfnt -lplibsg -lplibul $(GLUT_LIBS) \
$(OGL_LIBS)
+pview_LDADD = -lplibssg -lplibpu -lplibfnt -lplibsg -lplibul $(GLUT_LIBS) $(OGL_LIBS)
+
endif
EXTRA_DIST = viewer.dsp
|