]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/scenery.cxx
Small tweaks to initialization sequence and logic so we can default to
[flightgear.git] / src / Scenery / scenery.cxx
index e74a2ad245ff026d1edd9efe16d4d6008997a977..1341d21d42cb3a4481974c4d415cedfa1c8616f7 100644 (file)
 #endif
 
 #include <GL/glut.h>
-#include <simgear/xgl/xgl.h>
+#include <GL/gl.h>
 
 #include <stdio.h>
 #include <string.h>
 
 #include <simgear/debug/logstream.hxx>
 
-#include <Main/options.hxx>
+#include <Main/fg_props.hxx>
 
 #include "scenery.hxx"
 
 
-// Temporary hack until we get a better texture management system running
-GLint area_texture;
-
-
 // Shared structure to hold current scenery parameters
-struct fgSCENERY scenery;
-
-
-// Initialize the Scenery Management system
-int fgSceneryInit( void ) {
-    fgOPTIONS *o;
-    // char path[1024], fgpath[1024];
-    // GLubyte *texbuf;
-    // int width, height;
-
-    o = &current_options;
+FGScenery scenery;
 
-    FG_LOG( FG_TERRAIN, FG_INFO, "Initializing scenery subsystem" );
 
-    scenery.cur_elev = -9999;
+// Scenery Management system
+FGScenery::FGScenery() {
+    SG_LOG( SG_TERRAIN, SG_INFO, "Initializing scenery subsystem" );
 
-    return(1);
+    center = Point3D(0.0);
+    cur_elev = -9999;
 }
 
-
-// Tell the scenery manager where we are so it can load the proper data, and
-// build the proper structures.
-void fgSceneryUpdate(double lon, double lat, double elev) {
-    // does nothing;
+// Initialize the Scenery Management system
+FGScenery::~FGScenery() {
 }
 
+void FGScenery::init() {
+}
 
-// Render out the current scene
-void fgSceneryRender( void ) {
+void FGScenery::update() {
 }
 
+void FGScenery::bind() {
+    fgTie("/environment/ground-elevation-m", this,
+         &FGScenery::get_cur_elev, &FGScenery::set_cur_elev);
+}
 
+void FGScenery::unbind() {
+    fgUntie("/environment/ground-elevation-m");
+}