1
0
Fork 0

Remove a possible glut dependency and do some code cleaning

This commit is contained in:
ehofman 2003-08-29 16:46:21 +00:00
parent 3ba01fa762
commit 82ba3ebbde
3 changed files with 16 additions and 17 deletions

View file

@ -101,16 +101,9 @@
#include "splash.hxx" #include "splash.hxx"
#include "fg_commands.hxx" #include "fg_commands.hxx"
#include "fg_io.hxx" #include "fg_io.hxx"
#include "main.hxx"
glPointParameterfProc glPointParameterfPtr = 0;
glPointParameterfvProc glPointParameterfvPtr = 0;
bool glPointParameterIsSupported = false;
float default_attenuation[3] = {1.0, 0.0, 0.0}; float default_attenuation[3] = {1.0, 0.0, 0.0};
//Required for using GL_extensions
void fgLoadDCS (void);
void fgUpdateDCS (void);
ssgSelector *ship_sel=NULL; ssgSelector *ship_sel=NULL;
// upto 32 instances of a same object can be loaded. // upto 32 instances of a same object can be loaded.
ssgTransform *ship_pos[32]; ssgTransform *ship_pos[32];
@ -127,6 +120,10 @@ float scene_farplane = 120000.0f;
static double delta_time_sec = 0.0; static double delta_time_sec = 0.0;
glPointParameterfProc glPointParameterfPtr = 0;
glPointParameterfvProc glPointParameterfvPtr = 0;
bool glPointParameterIsSupported = false;
#ifdef FG_WEATHERCM #ifdef FG_WEATHERCM
# include <WeatherCM/FGLocalWeatherDatabase.h> # include <WeatherCM/FGLocalWeatherDatabase.h>

View file

@ -2,10 +2,15 @@
#ifndef __FG_MAIN_HXX #ifndef __FG_MAIN_HXX
#define __FG_MAIN_HXX 1 #define __FG_MAIN_HXX 1
class SGSky; #include <simgear/screen/extensions.hxx>
class SGSky;
extern SGSky *thesky; extern SGSky *thesky;
extern glPointParameterfProc glPointParameterfPtr;
extern glPointParameterfvProc glPointParameterfvPtr;
extern bool glPointParameterIsSupported;
void fgLoadDCS (void); void fgLoadDCS (void);
void fgUpdateDCS (void); void fgUpdateDCS (void);
void fgBuildRenderStates( void ); void fgBuildRenderStates( void );
@ -14,8 +19,6 @@ void fgRenderFrame();
void fgUpdateTimeDepCalcs(); void fgUpdateTimeDepCalcs();
void fgInitTimeDepCalcs( void ); void fgInitTimeDepCalcs( void );
void fgReshape( int width, int height ); void fgReshape( int width, int height );
void fgLoadDCS(void);
void fgUpdateDCS (void);
bool fgMainInit( int argc, char **argv ); bool fgMainInit( int argc, char **argv );

View file

@ -27,6 +27,9 @@
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <Main/main.hxx>
#include STL_STRING #include STL_STRING
#include <simgear/bucket/newbucket.hxx> #include <simgear/bucket/newbucket.hxx>
@ -448,28 +451,24 @@ void FGTileEntry::prep_ssg_node( const Point3D& p, sgVec3 up, float vis) {
// Set up lights rendering call backs // Set up lights rendering call backs
static int fgLightsPredraw( ssgEntity *e ) { static int fgLightsPredraw( ssgEntity *e ) {
#if 0 #if 0
#ifdef GL_EXT_point_parameters if (glPointParameterIsSupported) {
if (glutExtensionSupported("GL_EXT_point_parameters")) {
static float quadratic[3] = {1.0, 0.01, 0.0001}; static float quadratic[3] = {1.0, 0.01, 0.0001};
glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, quadratic); glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, quadratic);
glPointParameterfEXT(GL_POINT_SIZE_MIN_EXT, 1.0); glPointParameterfEXT(GL_POINT_SIZE_MIN_EXT, 1.0);
glPointSize(4.0); glPointSize(4.0);
} }
#endif
#endif #endif
return true; return true;
} }
static int fgLightsPostdraw( ssgEntity *e ) { static int fgLightsPostdraw( ssgEntity *e ) {
#if 0 #if 0
#ifdef GL_EXT_point_parameters if (glPointParameterIsSupported) {
if (glutExtensionSupported("GL_EXT_point_parameters")) {
static float default_attenuation[3] = {1.0, 0.0, 0.0}; static float default_attenuation[3] = {1.0, 0.0, 0.0};
glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT,
default_attenuation); default_attenuation);
glPointSize(1.0); glPointSize(1.0);
} }
#endif
#endif #endif
return true; return true;
} }