From 5628c85b5112ccb4cc6ab2f6121fb0750bd614aa Mon Sep 17 00:00:00 2001 From: ehofman Date: Sat, 16 Aug 2003 12:30:25 +0000 Subject: [PATCH] Frederic Bouvier: This patch was inspired by Norman. Otherwise there is a segfault on Linux because the global variable tries to access OGL before a valid context is initialized. --- simgear/scene/sky/clouds3d/SkySceneLoader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simgear/scene/sky/clouds3d/SkySceneLoader.cpp b/simgear/scene/sky/clouds3d/SkySceneLoader.cpp index 7ab82735..d629171c 100644 --- a/simgear/scene/sky/clouds3d/SkySceneLoader.cpp +++ b/simgear/scene/sky/clouds3d/SkySceneLoader.cpp @@ -49,7 +49,7 @@ Point3D origin; Camera *pCam = new Camera(); // Need to add a light here until we figure out how to use the sun position and color SkyLight::SkyLightType eType = SkyLight::SKY_LIGHT_DIRECTIONAL; -SkyLight *pLight = new SkyLight(eType); +SkyLight *pLight = 0; // hack sgMat4 my_copy_of_ssgOpenGLAxisSwapMatrix = @@ -105,6 +105,7 @@ SkySceneLoader::~SkySceneLoader() //bool SkySceneLoader::Load(std::string filepath) bool SkySceneLoader::Load( unsigned char *data, unsigned int size, double latitude, double longitude ) { + pLight = new SkyLight(eType); // Need to create the managers cout << "GraphicsContext::Instantiate();" << endl; GraphicsContext::Instantiate(); -- 2.39.5