Commit Graph

19 Commits

Author SHA1 Message Date
Benau
c337976413 Use unicode windows build with enabling directinput support in mingw 2019-06-26 11:32:18 +08:00
Deve
7cc4c92b31 Fixed compilation with current mesa.
It fixes #3557.
2018-11-14 20:59:00 +01:00
Rémi Verschelde
2a093cde0a GLEW: Update to pristine upstream 2.1.0
Previous version was a modified GLEW 1.11.0 (2014). The STK modifications meant
to address https://sourceforge.net/p/glew/patches/40/ which is now fixed since
GLEW 2.0.0.

Here's the diff between pristine 1.11.0 and STK's version before this patch:
```diff
diff --git a/lib/glew/src/glew.c b/lib/glew/src/glew.c
index a78f14e1e..f8df0d758 100644
--- a/lib/glew/src/glew.c
+++ b/lib/glew/src/glew.c
@@ -296,30 +296,6 @@ static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuin
   return GL_FALSE;
 }

-#include <string.h>
-#include <stdlib.h>
-
-/* A simple open addressing hashset for extensions on OpenGL 3+. */
-static const char ** ext_hashset = NULL;
-size_t ext_hashset_size = 0;
-
-static unsigned hash_string(const char * key)
-{
-  unsigned hash = 0;
-  unsigned i = 0;
-  for (; i < strlen(key); ++i)
-  {
-    hash += key[i];
-    hash += (hash << 10);
-    hash ^= (hash >> 6);
-  }
-  hash += (hash << 3);
-  hash ^= (hash >> 11);
-  hash += (hash << 15);
-
-  return hash;
-}
-
 /*
  * Search for name in the extensions string. Use of strstr()
  * is not sufficient because extension names can be prefixes of
@@ -328,37 +304,14 @@ static unsigned hash_string(const char * key)
  */
 static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end)
 {
-  if (ext_hashset != NULL)
+  const GLubyte* p;
+  GLuint len = _glewStrLen((const GLubyte*)name);
+  p = start;
+  while (p < end)
   {
-    unsigned hash = hash_string(name);
-
-    /*
-     * As the hashset is bigger than the number of extensions
-     * this will eventually break.
-     */
-    while(1)
-    {
-        unsigned index = hash % ext_hashset_size;
-        if (ext_hashset[index] == NULL)
-            break;
-
-        if (!strcmp(ext_hashset[index], name))
-            return GL_TRUE;
-
-        hash++;
-    }
-  }
-  else
-  {
-    const GLubyte* p;
-    GLuint len = _glewStrLen((const GLubyte*)name);
-    p = start;
-    while (p < end)
-    {
-      GLuint n = _glewStrCLen(p, ' ');
-      if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
-      p += n+1;
-    }
+    GLuint n = _glewStrCLen(p, ' ');
+    if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
+    p += n+1;
   }
   return GL_FALSE;
 }
@@ -10099,13 +10052,9 @@ static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT)
 /* ------------------------------------------------------------------------- */

 GLboolean GLEWAPIENTRY glewGetExtension (const char* name)
-{
+{
   const GLubyte* start;
   const GLubyte* end;
-
-  if (ext_hashset != NULL)
-      return _glewSearchExtension(name, NULL, NULL);
-
   start = (const GLubyte*)glGetString(GL_EXTENSIONS);
   if (start == 0)
     return GL_FALSE;
@@ -10165,39 +10114,9 @@ GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
     GLEW_VERSION_1_2   = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE;
     GLEW_VERSION_1_1   = GLEW_VERSION_1_2   == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
   }
-
-  if (major >= 3) /* glGetString method is deprecated */
-  {
-    GLint n, i;
-    glGetIntegerv(GL_NUM_EXTENSIONS, &n);
-    glGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress((const GLubyte*)"glGetStringi");
-
-    free(ext_hashset); /* In case we get called a second time. */
-
-    ext_hashset_size = (n * 3) / 2;
-    ext_hashset = calloc(ext_hashset_size, sizeof(const char *));
-    for (i = 0; i < n; ++i)
-    {
-      const char * extension;
-      unsigned hash;
-
-      extension = (const char *)glGetStringi(GL_EXTENSIONS, i);
-      hash = hash_string(extension);
-
-      while(ext_hashset[hash % ext_hashset_size] != NULL)
-        hash++;
-
-      ext_hashset[hash % ext_hashset_size] = extension;
-    }
-
-    extStart = 0;
-  }
-  else
-  {
-    /* query opengl extensions string */
-    extStart = glGetString(GL_EXTENSIONS);
-  }

+  /* query opengl extensions string */
+  extStart = glGetString(GL_EXTENSIONS);
   if (extStart == 0)
     extStart = (const GLubyte*)"";
   extEnd = extStart + _glewStrLen(extStart);
@@ -14064,9 +13983,6 @@ GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST)
   GLXEW_VERSION_1_2 = GL_TRUE;
   GLXEW_VERSION_1_3 = GL_TRUE;
   GLXEW_VERSION_1_4 = GL_TRUE;
-  /* Check if GLX display is available */
-  if (glXGetCurrentDisplay == NULL || glXGetCurrentDisplay() == NULL)
-    return GLEW_OK;
   /* query GLX version */
   glXQueryVersion(glXGetCurrentDisplay(), &major, &minor);
   if (major == 1 && minor <= 3)
```
2017-11-22 12:04:46 +01:00
Deve
9b7f3d70dd One more place where we were linking with glu.
It doesn't really matter, but it's better that our linux package doesn't depend on it.
2017-07-05 21:49:31 +02:00
Deve
961ac4d79e Better fix for glew 2017-05-14 00:06:54 +02:00
Deve
035c33f960 Merge branch 'master' into wayland 2017-04-22 21:11:10 +02:00
hiker
8d9bb9c30f Cherry picked commits from old pi branch (which was based on dumb client). 2016-11-11 17:21:59 +11:00
deve
cabc696710 Fixed compilation with cmake 3.6 2016-09-26 11:28:19 +02:00
Deve
56c6062a81 One more tweak..... 2016-06-04 00:10:56 +02:00
Deve
d60d9120b4 Define constants in glew cmake file before 'add_library' function.
It was working for me as it was before, but based on this comment: 10488bc79a (commitcomment-17724549) it looks that some cmake versions may ignore definitions that are defined below add_library.
2016-06-03 06:48:46 +02:00
Deve
10488bc79a Don't link libGLU library.
This should allow to run linux static package even if libglu1-mesa package is not installed. And the utilities from GLU library are not used in STK anyway.
2016-05-12 23:38:56 +02:00
Marianne Gagnon
33defa44b7 Merge most modifications by egirsova to build 64-bits on OS X 2016-03-21 20:16:59 -04:00
Vincent Lejeune
874d63f5bc WIP wayland 2015-02-01 18:53:12 +01:00
leper
1718cb2fce FreeBSD build fixes.
Irrlicht change also submitted upstream https://sourceforge.net/p/irrlicht/patches/300/.
2015-01-02 17:58:16 +01:00
hiker
8ca7730570 Removed unnecessary source file in glew. 2014-09-30 15:01:38 +10:00
Marianne Gagnon
7b5ce0f9d7 Fix compilation, why this didn't work for me but works for others is a mystery 2014-09-27 19:07:29 -04:00
vlj
9cc98f57e3 Reapply patch from http://sourceforge.net/p/glew/patches/40/
This reverts commit dd70f09fce.
2014-09-27 18:49:33 +02:00
hiker
8029bc5880 Build a static version of glew. 2014-09-15 21:49:06 +10:00
hiker
69473b1811 Try to include glew in stk. 2014-09-15 16:33:46 +10:00