Index: /trunk/src/VBox/GuestHost/OpenGL/include/cr_blitter.h
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/include/cr_blitter.h	(revision 48347)
+++ /trunk/src/VBox/GuestHost/OpenGL/include/cr_blitter.h	(revision 48348)
@@ -32,5 +32,5 @@
 typedef struct CR_GLSL_CACHE
 {
-    float glVersion;
+    int iGlVersion;
     GLuint uNoAlpha2DProg;
     GLuint uNoAlpha2DRectProg;
@@ -41,5 +41,4 @@
 {
     memset(pCache, 0, sizeof (*pCache));
-    pCache->glVersion = 0.0;
     pCache->pDispatch = pDispatch;
 }
Index: /trunk/src/VBox/GuestHost/OpenGL/include/cr_string.h
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/include/cr_string.h	(revision 48347)
+++ /trunk/src/VBox/GuestHost/OpenGL/include/cr_string.h	(revision 48348)
@@ -37,4 +37,28 @@
 DECLEXPORT(void)    crWordsToString( char *string, int nstring, void *data, int ndata );
 
+#define CR_GLVERSION_OFFSET_MAJOR (24)
+#define CR_GLVERSION_OFFSET_MINOR (16)
+#define CR_GLVERSION_OFFSET_BUILD (0)
+
+#define CR_GLVERSION_MAX_MAJOR (0x7f)
+#define CR_GLVERSION_MAX_MINOR (0xff)
+#define CR_GLVERSION_MAX_BUILD (0xffff)
+
+#define CR_GLVERSION_MASK_MAJOR (CR_GLVERSION_MAX_MAJOR << CR_GLVERSION_OFFSET_MAJOR)
+#define CR_GLVERSION_MASK_MINOR (CR_GLVERSION_MAX_MINOR << CR_GLVERSION_OFFSET_MINOR)
+#define CR_GLVERSION_MASK_BUILD (CR_GLVERSION_MAX_BUILD << CR_GLVERSION_OFFSET_BUILD)
+
+#define CR_GLVERSION_COMPOSE_EL(_val, _type) (((_val) << CR_GLVERSION_OFFSET_##_type) & CR_GLVERSION_MASK_##_type)
+
+#define CR_GLVERSION_COMPOSE(_maj, _min, _build) (CR_GLVERSION_COMPOSE_EL((_maj), MAJOR) \
+        + CR_GLVERSION_COMPOSE_EL((_min), MINOR) \
+        + CR_GLVERSION_COMPOSE_EL((_build), BUILD))
+
+#define CR_GLVERSION_GET_EL(_val, _type) (((_val) & CR_GLVERSION_MASK_##_type) >> CR_GLVERSION_OFFSET_##_type)
+#define CR_GLVERSION_GET_MAJOR(_val) CR_GLVERSION_GET_EL((_val), MAJOR)
+#define CR_GLVERSION_GET_MINOR(_val) CR_GLVERSION_GET_EL((_val), MINOR)
+#define CR_GLVERSION_GET_BUILD(_val) CR_GLVERSION_GET_EL((_val), BUILD)
+
+DECLEXPORT(int) crStrParseGlVersion(const char * ver);
 RT_C_DECLS_END
 
Index: /trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp	(revision 48347)
+++ /trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp	(revision 48348)
@@ -823,16 +823,19 @@
 VBOXBLITTERDECL(bool) CrGlslIsSupported(CR_GLSL_CACHE *pCache)
 {
-    if (pCache->glVersion == 0.)
+    if (pCache->iGlVersion == 0)
     {
         const char * pszStr = (const char*)pCache->pDispatch->GetString(GL_VERSION);
-        pCache->glVersion = crStrToFloat(pszStr);
-        if (pCache->glVersion == 0.)
-        {
-            crWarning("pCache->glVersion is null!");
-        }
-    }
-
-    if (pCache->glVersion >= 2.0)
+        pCache->iGlVersion = crStrParseGlVersion(pszStr);
+        if (pCache->iGlVersion <= 0)
+        {
+            crWarning("crStrParseGlVersion returned %d", pCache->iGlVersion);
+            pCache->iGlVersion = -1;
+        }
+    }
+
+    if (pCache->iGlVersion >= CR_GLVERSION_COMPOSE(2, 0, 0))
         return true;
+
+    crWarning("GLSL unsuported, gl version %d", pCache->iGlVersion);
 
     /* @todo: we could also check for GL_ARB_shader_objects and GL_ARB_fragment_shader,
@@ -865,5 +868,5 @@
     }
 
-    if (pCache->glVersion >= 2.1)
+    if (pCache->iGlVersion >= CR_GLVERSION_COMPOSE(2, 1, 0))
     {
         if (enmTexTarget == GL_TEXTURE_2D)
@@ -875,5 +878,5 @@
         return NULL;
     }
-    else if (pCache->glVersion >= 2.0)
+    else if (pCache->iGlVersion >= CR_GLVERSION_COMPOSE(2, 0, 0))
     {
         if (enmTexTarget == GL_TEXTURE_2D)
@@ -932,5 +935,4 @@
 #endif
         {
-            Assert(0);
             crWarning("compile FAILURE:\n-------------------\n%s\n--------\n", pBuf);
             rc = VERR_NOT_SUPPORTED;
@@ -967,5 +969,4 @@
 #endif
         {
-            Assert(0);
             crWarning("link FAILURE:\n-------------------\n%s\n--------\n", pBuf);
             rc = VERR_NOT_SUPPORTED;
Index: /trunk/src/VBox/GuestHost/OpenGL/util/string.c
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/util/string.c	(revision 48347)
+++ /trunk/src/VBox/GuestHost/OpenGL/util/string.c	(revision 48348)
@@ -7,4 +7,5 @@
 #include "cr_mem.h"
 #include "cr_string.h"
+#include "cr_error.h"
 
 #include <string.h>
@@ -409,2 +410,124 @@
   return c >= '0' && c <= '9';
 }
+
+
+static int crStrParseGlSubver(const char * ver, const char ** pNext, bool bSpacePrefixAllowed)
+{
+    const char * initVer = ver;
+    int val = 0;
+
+    for(;;++ver)
+    {
+        if(*ver >= '0' && *ver <= '9')
+        {
+            if(!val)
+            {
+                if(*ver == '0')
+                    continue;
+            }
+            else
+            {
+                val *= 10;
+            }
+            val += *ver - '0';
+        }
+        else if(*ver == '.')
+        {
+            *pNext = ver+1;
+            break;
+        }
+        else if(*ver == '\0')
+        {
+            *pNext = NULL;
+            break;
+        }
+        else if(*ver == ' ' || *ver == '\t' ||  *ver == 0x0d || *ver == 0x0a)
+        {
+            if(bSpacePrefixAllowed)
+            {
+                if(!val)
+                {
+                    continue;
+                }
+            }
+
+            /* treat this as the end of version string */
+            *pNext = NULL;
+            break;
+        }
+        else
+        {
+            crWarning("error parsing version %s", initVer);
+            val = -1;
+            break;
+        }
+    }
+
+    return val;
+}
+
+int crStrParseGlVersion(const char * ver)
+{
+    const char * initVer = ver;
+    int tmp;
+    int iVer = crStrParseGlSubver(ver, &ver, true);
+    if(iVer <= 0)
+    {
+        crWarning("parsing major version returned %d, '%s'", iVer, initVer);
+        return iVer;
+    }
+
+    if (iVer > CR_GLVERSION_MAX_MAJOR)
+    {
+        crWarning("major version %d is bigger than the max supported %#x, this is somewhat not expected, failing", iVer, CR_GLVERSION_MAX_MAJOR);
+        return -1;
+    }
+
+    iVer <<= CR_GLVERSION_OFFSET_MAJOR;
+    if(!ver)
+    {
+        crDebug("no minor version supplied");
+        goto done;
+    }
+
+    tmp = crStrParseGlSubver(ver, &ver, false);
+    if (tmp < 0)
+    {
+        crWarning("parsing minor version failed, '%s'", initVer);
+        return -1;
+    }
+
+    if (tmp > CR_GLVERSION_MAX_MINOR)
+    {
+        crWarning("minor version %d is bigger than the max supported %#x, this is somewhat not expected, failing", iVer, CR_GLVERSION_MAX_MAJOR);
+        return -1;
+    }
+
+    iVer |= tmp << CR_GLVERSION_OFFSET_MINOR;
+
+    if (!ver)
+    {
+        crDebug("no build version supplied");
+        goto done;
+    }
+
+    tmp = crStrParseGlSubver(ver, &ver, false);
+    if (tmp < 0)
+    {
+        crWarning("parsing build version failed, '%s', using 0", initVer);
+        tmp = 0;
+    }
+
+    if (tmp > CR_GLVERSION_MAX_BUILD)
+    {
+        crWarning("build version %d is bigger than the max supported, using max supported val %#x", tmp, CR_GLVERSION_MAX_BUILD);
+        tmp = CR_GLVERSION_MAX_MAJOR;
+    }
+
+    iVer |= tmp << CR_GLVERSION_OFFSET_BUILD;
+
+done:
+    crDebug("returning version %#x for string '%s'", iVer, initVer);
+
+    return iVer;
+}
Index: /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m	(revision 48347)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m	(revision 48348)
@@ -1425,5 +1425,5 @@
     Assert(WinInfo.height = m_RootRect.size.height);
 
-    CrBltMuralSetCurrent(m_pBlitter, NULL);
+    /*CrBltMuralSetCurrent(m_pBlitter, NULL);*/
     
     CrBltMuralSetCurrent(m_pBlitter, &WinInfo);
