Sophie

Sophie

distrib > Mandriva > 2007.1 > x86_64 > by-pkgid > 614481366e79cd8aa8fdf261ea61ee43 > files > 3

stellarium-0.8.2-2mdv2007.1.src.rpm

Index: stellarium-0.8.2/src/stel_core.cpp
===================================================================
--- stellarium-0.8.2.orig/src/stel_core.cpp	2007-01-05 21:30:38.289263410 +0100
+++ stellarium-0.8.2/src/stel_core.cpp	2007-01-05 21:33:08.846672660 +0100
@@ -70,9 +70,6 @@
     dataRoot = DATA_ROOT;
     recordActionCallback = recordCallback;
 
-    projection = Projector::create(Projector::PERSPECTIVE_PROJECTOR, Vec4i(0,0,800,600), 60);
-    glFrontFace(projection->needGlFrontFaceCW()?GL_CW:GL_CCW);
-
     tone_converter = new ToneReproductor();
     atmosphere = new Atmosphere();
     hip_stars = new HipStarMgr();
@@ -135,6 +132,10 @@
 // Load core data and initialize with default values
 void StelCore::init(const InitParser& conf)
 {
+    // do NOT do this in the constructor as there is no valid GLcontext there!
+    projection = Projector::create(Projector::PERSPECTIVE_PROJECTOR, Vec4i(0,0,800,600), 60);
+    glFrontFace(projection->needGlFrontFaceCW()?GL_CW:GL_CCW);
+
     baseFontFile = getDataDir() + conf.get_str("gui", "base_font_name", "DejaVuSans.ttf");
 
     // Video Section