]> git.mxchange.org Git - flightgear.git/blobdiff - src/Objects/matlib.cxx
I'm attaching diffs to add a new FGInput module to FlightGear
[flightgear.git] / src / Objects / matlib.cxx
index 60fa40ea5b2205544a423bbfee99cd669adff15f..ac2be6b947324c9dc2168562000846a405ad965d 100644 (file)
@@ -34,7 +34,7 @@
 #endif
 
 #include <GL/glut.h>
-#include <simgear/xgl/xgl.h>
+#include <GL/gl.h>
 
 #include <simgear/compiler.h>
 
@@ -278,11 +278,23 @@ void FGMaterialLib::set_step ( int step )
 }
 
 
-
-
-
-
-
-
-
-
+// Load one pending "deferred" texture.  Return true if a texture
+// loaded successfully, false if no pending, or error.
+void FGMaterialLib::load_next_deferred() {
+    // container::iterator it = begin();
+    for ( material_map_iterator it = begin(); it != end(); it++ ) {
+       const string &key = it->first;
+       FGNewMat &slot = it->second;
+       if ( ! slot.get_texture_loaded() ) {
+            SG_LOG( SG_GENERAL, SG_INFO, "Loading texture for " << key );
+#ifdef PLIB_1_2_X
+            slot.get_textured()->
+                setTexture( (char *)slot.get_texture_name_c_str(), 0, 0 );
+#else
+            slot.get_textured()->
+                setTexture( (char *)slot.get_texture_name_c_str(), 0, 0, 1 );
+#endif
+            slot.set_texture_loaded( true );
+        }
+    }
+}