uifw/ganes/src/HgVgEGL.cpp
branchRCL_3
changeset 21 978afdc0236f
parent 20 d48ab3b357f1
--- a/uifw/ganes/src/HgVgEGL.cpp	Wed Sep 01 12:16:19 2010 +0100
+++ b/uifw/ganes/src/HgVgEGL.cpp	Tue Sep 14 21:48:24 2010 +0300
@@ -47,6 +47,12 @@
 void CHgVgEGL::ConstructL (RWindow& aWindow)
     {
     InitEGL(aWindow);
+    // Enable flag that is used to determine whether egl has been initialized.
+    // For example vgImages shouldn't be created before egl has been initialized.
+    // There will be only one instance of this class so there is no need to check
+    // whether there is already something in the DLL tls.
+    TBool* eglInitialized = new TBool(ETrue);
+    Dll::SetTls((TAny*)eglInitialized);
     }
 
 // -----------------------------------------------------------------------------
@@ -66,6 +72,10 @@
 CHgVgEGL::~CHgVgEGL ( )
     {
     DestroyEGL();
+    // Disable flag that is used to determine whether egl has been initialized.
+    // For example vgImages shouldn't be created before egl has been initialized.
+    delete Dll::Tls();
+    Dll::FreeTls();
     }
 
 // ---------------------------------------------------------------------------
@@ -357,4 +367,14 @@
     return bitmap;    
     }
 
+// ---------------------------------------------------------------------------
+// CHgVgEGL::EglInitialized()
+// ---------------------------------------------------------------------------
+//     
+TBool CHgVgEGL::EglInitialized()
+{
+    TBool* eglInitialized = (TBool*)Dll::Tls();
+    return eglInitialized ? *eglInitialized : EFalse;
+}
+
 // End of File