← Back to team overview

hugin-devs team mailing list archive

[Bug 2007178] Re: Replace GLEW with epoxy

 

I installed MSYS2 and built with that, most of the work was hacking
Hugin CMakeLists to find the MSYS2 packages.

MSYS2 has an epoxy package, and supports pkg-config, the actual code changes from the last patch required below (I also modified win_bundle.cmake but that was a quick MSYS2 hack).
There were compilation errors in including glu.h in utils.cpp. Instead I changed from gluOrtho2D to glOrtho:
https://learn.microsoft.com/en-us/windows/win32/opengl/gluortho2d#remarks
And also lost the conversion of the GL error code to a message, something else to look at.


But I can then run nona from PowerShell:

PS > ./nona -g -o out .\TEST.pto
nona.exe: using graphics card: ATI Technologies Inc. AMD Radeon HD 6950

and hugin.exe by double-clicking from file explorer, and open fast
preview.


Updated complete patch:
https://sourceforge.net/u/cjmayo/hugin/ci/274d3b105105a3b2db892095609f23d34a21134d/


```diff
--- a/src/hugin_base/hugin_utils/utils.cpp
+++ b/src/hugin_base/hugin_utils/utils.cpp
@@ -58,7 +58,9 @@
 #endif
 
 #include <epoxy/gl.h>
-#if defined __APPLE__
+#ifdef _WIN32
+#include <epoxy/wgl.h>
+#elif defined __APPLE__
   #include <GLUT/glut.h>
 #endif
 
diff --git a/src/hugin_base/vigra_ext/ImageTransformsGPU.cpp b/src/hugin_base/vigra_ext/ImageTransformsGPU.cpp
index b1271ae75..635e9d8fe 100644
--- a/src/hugin_base/vigra_ext/ImageTransformsGPU.cpp
+++ b/src/hugin_base/vigra_ext/ImageTransformsGPU.cpp
@@ -27,14 +27,6 @@
 #include <iomanip>
 
 #include <epoxy/gl.h>
-#ifdef __WXMAC__
-#include <OpenGL/glu.h>
-#else
-#include <GL/glu.h>
-#endif
-#ifdef __APPLE__
-  #include <GLUT/glut.h>
-#endif
 
 #include <string.h>
 #ifdef _WIN32
@@ -121,7 +113,7 @@ static void checkGLErrors(int line, char* file) {
     {
         while (errCode != GL_NO_ERROR)
         {
-            const GLubyte* message = gluErrorString(errCode);
+            const GLubyte* message ; //= gluErrorString(errCode);
             std::cerr << "nona: GL error in " << file << ":" << line << std::endl;
             if (message)
             {
@@ -806,7 +798,7 @@ bool transformImageGPUIntern(const std::string& coordXformGLSL,
     const int viewportHeight = std::max<int>(destChunks[0].height(), sourceChunks[0].height());
     glMatrixMode(GL_PROJECTION);
     glLoadIdentity();
-    gluOrtho2D(0.0, viewportWidth, 0.0, viewportHeight);
+    glOrtho(0.0, viewportWidth, 0.0, viewportHeight, -1, 1);
     glMatrixMode(GL_MODELVIEW);
     glLoadIdentity();
     glViewport(0, 0, viewportWidth, viewportHeight);
```

-- 
You received this bug notification because you are a member of Hugin
Developers, which is subscribed to Hugin.
https://bugs.launchpad.net/bugs/2007178

Title:
  Replace GLEW with epoxy

Status in Hugin:
  New

Bug description:
  GLEW is installed for either GLX or EGL, making it impossible to switch to EGL if some applications need GLX.
  epoxy also does not need to be initialised, making startup faster.
  GTK, Firefox and Libreoffice are among those using epoxy.

  Patch (not sure the best way to work with Launchpad and/or Sourceforge...):
  https://sourceforge.net/p/hugin/hugin/merge-requests/2/

  A draft that has only been tested on Linux and at the moment uses
  PKG_SEARCH_MODULE to find epoxy. So, may work on macOS (libepoxy is
  available in Homebrew) but more work for Windows and other supporting
  scripts.

To manage notifications about this bug go to:
https://bugs.launchpad.net/hugin/+bug/2007178/+subscriptions



References