0032206: Visualization, TKOpenGl - move out OpenGL ES support to dedicated library...
[occt.git] / src / ViewerTest / ViewerTest_ViewerCommands.cxx
index f206d00..21ed553 100644 (file)
@@ -1688,7 +1688,12 @@ TCollection_AsciiString ViewerTest::ViewerInit (const Standard_Integer thePxLeft
     aFactory = Graphic3d_GraphicDriverFactory::DefaultDriverFactory();
     if (aFactory.IsNull())
     {
-      throw Standard_ProgramError("Error: no graphic driver factory found");
+      Draw::GetInterpretor().Eval ("pload GLES");
+      aFactory = Graphic3d_GraphicDriverFactory::DefaultDriverFactory();
+      if (aFactory.IsNull())
+      {
+        throw Standard_ProgramError("Error: no graphic driver factory found");
+      }
     }
   }
 
@@ -2020,6 +2025,12 @@ static int VDriver (Draw_Interpretor& theDi, Standard_Integer theArgsNb, const c
     {
       aNewActive = "tkopengl";
     }
+    else if (TCollection_AsciiString::IsSameString (aNewActive, "gles", false)
+          || TCollection_AsciiString::IsSameString (aNewActive, "opengles", false)
+          || TCollection_AsciiString::IsSameString (aNewActive, "tkopengles", false))
+    {
+      aNewActive = "tkopengles";
+    }
     else if (TCollection_AsciiString::IsSameString (aNewActive, "d3d", false)
           || TCollection_AsciiString::IsSameString (aNewActive, "d3dhost", false)
           || TCollection_AsciiString::IsSameString (aNewActive, "tkd3dhost", false))
@@ -2033,6 +2044,10 @@ static int VDriver (Draw_Interpretor& theDi, Standard_Integer theArgsNb, const c
       {
         Draw::GetInterpretor().Eval ("pload OPENGL");
       }
+      else if (aNewActive == "tkopengles")
+      {
+        Draw::GetInterpretor().Eval ("pload GLES");
+      }
       else if (aNewActive == "tkd3dhost")
       {
         Draw::GetInterpretor().Eval ("pload D3DHOST");