Tweaked smooth shaded texture lighting properties.
Converted fgLIGHT to a C++ class.
This commit is contained in:
parent
e57fd21bd3
commit
081b63cfbb
3 changed files with 19 additions and 16 deletions
|
@ -35,6 +35,7 @@
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
#include <XGL/xgl.h>
|
#include <XGL/xgl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef HAVE_STDLIB_H
|
#ifdef HAVE_STDLIB_H
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
|
@ -214,6 +215,9 @@ static void fgInitVisuals( void ) {
|
||||||
// draw wire frame
|
// draw wire frame
|
||||||
xglPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
|
xglPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is the default anyways, but it can't hurt
|
||||||
|
xglFrontFace ( GL_CCW );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -335,6 +339,7 @@ static void fgRenderFrame( void ) {
|
||||||
double angle;
|
double angle;
|
||||||
GLfloat black[4] = { 0.0, 0.0, 0.0, 1.0 };
|
GLfloat black[4] = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
|
GLfloat gray90[4] = { 0.9, 0.9, 0.9, 1.0 };
|
||||||
GLfloat terrain_color[4] = { 0.54, 0.44, 0.29, 1.0 };
|
GLfloat terrain_color[4] = { 0.54, 0.44, 0.29, 1.0 };
|
||||||
|
|
||||||
l = &cur_light_params;
|
l = &cur_light_params;
|
||||||
|
@ -424,7 +429,7 @@ static void fgRenderFrame( void ) {
|
||||||
xglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ) ;
|
xglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ) ;
|
||||||
xglHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ) ;
|
xglHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ) ;
|
||||||
// set base color (I don't think this is doing anything here)
|
// set base color (I don't think this is doing anything here)
|
||||||
xglMaterialfv (GL_FRONT, GL_AMBIENT, white);
|
xglMaterialfv (GL_FRONT, GL_AMBIENT, gray90);
|
||||||
xglMaterialfv (GL_FRONT, GL_DIFFUSE, white);
|
xglMaterialfv (GL_FRONT, GL_DIFFUSE, white);
|
||||||
} else {
|
} else {
|
||||||
xglDisable( GL_TEXTURE_2D );
|
xglDisable( GL_TEXTURE_2D );
|
||||||
|
@ -773,6 +778,10 @@ extern "C" {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.16 1998/05/20 20:51:33 curt
|
||||||
|
// Tweaked smooth shaded texture lighting properties.
|
||||||
|
// Converted fgLIGHT to a C++ class.
|
||||||
|
//
|
||||||
// Revision 1.15 1998/05/16 13:08:34 curt
|
// Revision 1.15 1998/05/16 13:08:34 curt
|
||||||
// C++ - ified views.[ch]xx
|
// C++ - ified views.[ch]xx
|
||||||
// Shuffled some additional view parameters into the fgVIEW class.
|
// Shuffled some additional view parameters into the fgVIEW class.
|
||||||
|
|
|
@ -73,7 +73,7 @@ VERSION = @VERSION@
|
||||||
|
|
||||||
EXTRA_DIST = runfg.in runfg.bat.in
|
EXTRA_DIST = runfg.in runfg.bat.in
|
||||||
|
|
||||||
bin_PROGRAMS = fg ttest
|
bin_PROGRAMS = fg
|
||||||
|
|
||||||
bin_SCRIPTS = runfg runfg.bat
|
bin_SCRIPTS = runfg runfg.bat
|
||||||
|
|
||||||
|
@ -103,8 +103,6 @@ fg_LDADD = \
|
||||||
$(top_builddir)/Lib/Bucket/libBucket.la \
|
$(top_builddir)/Lib/Bucket/libBucket.la \
|
||||||
$(top_builddir)/Lib/Debug/libDebug.la \
|
$(top_builddir)/Lib/Debug/libDebug.la \
|
||||||
$(top_builddir)/Lib/zlib/libz.la
|
$(top_builddir)/Lib/zlib/libz.la
|
||||||
|
|
||||||
ttest_SOURCES = ttest.cxx
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||||
CONFIG_HEADER = ../../Include/config.h
|
CONFIG_HEADER = ../../Include/config.h
|
||||||
CONFIG_CLEAN_FILES = runfg runfg.bat
|
CONFIG_CLEAN_FILES = runfg runfg.bat
|
||||||
|
@ -137,10 +135,6 @@ $(top_builddir)/Lib/Math/libMath.la \
|
||||||
$(top_builddir)/Lib/Bucket/libBucket.la \
|
$(top_builddir)/Lib/Bucket/libBucket.la \
|
||||||
$(top_builddir)/Lib/Debug/libDebug.la $(top_builddir)/Lib/zlib/libz.la
|
$(top_builddir)/Lib/Debug/libDebug.la $(top_builddir)/Lib/zlib/libz.la
|
||||||
fg_LDFLAGS =
|
fg_LDFLAGS =
|
||||||
ttest_OBJECTS = ttest.o
|
|
||||||
ttest_LDADD = $(LDADD)
|
|
||||||
ttest_DEPENDENCIES =
|
|
||||||
ttest_LDFLAGS =
|
|
||||||
SCRIPTS = $(bin_SCRIPTS)
|
SCRIPTS = $(bin_SCRIPTS)
|
||||||
|
|
||||||
CXXFLAGS = @CXXFLAGS@
|
CXXFLAGS = @CXXFLAGS@
|
||||||
|
@ -155,10 +149,10 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
TAR = tar
|
TAR = tar
|
||||||
GZIP = --best
|
GZIP = --best
|
||||||
DEP_FILES = .deps/GLUTkey.P .deps/GLUTmain.P .deps/airports.P \
|
DEP_FILES = .deps/GLUTkey.P .deps/GLUTmain.P .deps/airports.P \
|
||||||
.deps/fg_init.P .deps/options.P .deps/ttest.P .deps/views.P
|
.deps/fg_init.P .deps/options.P .deps/views.P
|
||||||
CXXMKDEP = $(CXX) -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)
|
CXXMKDEP = $(CXX) -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)
|
||||||
SOURCES = $(fg_SOURCES) $(ttest_SOURCES)
|
SOURCES = $(fg_SOURCES)
|
||||||
OBJECTS = $(fg_OBJECTS) $(ttest_OBJECTS)
|
OBJECTS = $(fg_OBJECTS)
|
||||||
|
|
||||||
all: Makefile $(PROGRAMS) $(SCRIPTS)
|
all: Makefile $(PROGRAMS) $(SCRIPTS)
|
||||||
|
|
||||||
|
@ -237,10 +231,6 @@ fg: $(fg_OBJECTS) $(fg_DEPENDENCIES)
|
||||||
@rm -f fg
|
@rm -f fg
|
||||||
$(CXXLINK) $(fg_LDFLAGS) $(fg_OBJECTS) $(fg_LDADD) $(LIBS)
|
$(CXXLINK) $(fg_LDFLAGS) $(fg_OBJECTS) $(fg_LDADD) $(LIBS)
|
||||||
|
|
||||||
ttest: $(ttest_OBJECTS) $(ttest_DEPENDENCIES)
|
|
||||||
@rm -f ttest
|
|
||||||
$(CXXLINK) $(ttest_LDFLAGS) $(ttest_OBJECTS) $(ttest_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
install-binSCRIPTS: $(bin_SCRIPTS)
|
install-binSCRIPTS: $(bin_SCRIPTS)
|
||||||
@$(NORMAL_INSTALL)
|
@$(NORMAL_INSTALL)
|
||||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||||
|
|
|
@ -300,7 +300,7 @@ int fgInitSubsystems( void ) {
|
||||||
fgUpdateSunPos();
|
fgUpdateSunPos();
|
||||||
|
|
||||||
// Initialize Lighting interpolation tables
|
// Initialize Lighting interpolation tables
|
||||||
fgLightInit();
|
l->Init();
|
||||||
|
|
||||||
// update the lighting parameters (based on sun angle)
|
// update the lighting parameters (based on sun angle)
|
||||||
fgEventRegister( "fgLightUpdate()", fgLightUpdate,
|
fgEventRegister( "fgLightUpdate()", fgLightUpdate,
|
||||||
|
@ -381,6 +381,10 @@ int fgInitSubsystems( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.14 1998/05/20 20:51:35 curt
|
||||||
|
// Tweaked smooth shaded texture lighting properties.
|
||||||
|
// Converted fgLIGHT to a C++ class.
|
||||||
|
//
|
||||||
// Revision 1.13 1998/05/16 13:08:35 curt
|
// Revision 1.13 1998/05/16 13:08:35 curt
|
||||||
// C++ - ified views.[ch]xx
|
// C++ - ified views.[ch]xx
|
||||||
// Shuffled some additional view parameters into the fgVIEW class.
|
// Shuffled some additional view parameters into the fgVIEW class.
|
||||||
|
|
Loading…
Reference in a new issue