OpenGL build error


#1

I get an error building JuceDemo.

Compiling juce_opengl.cpp
In file included from ../../../../modules/juce_opengl/juce_opengl.cpp:187:0:
../../../../modules/juce_opengl/native/juce_OpenGL_linux.h: In member function ‘void juce::OpenGLContext::NativeContext::initialiseOnRenderThread()’:
../../../../modules/juce_opengl/native/juce_OpenGL_linux.h:109:91: error: invalid conversion from ‘void*’ to ‘GLXContext {aka __GLXcontextRec*}’ [-fpermissive]
/usr/include/GL/glx.h:203:19: error:   initializing argument 3 of ‘__GLXcontextRec* glXCreateContext(Display*, XVisualInfo*, GLXContext, int)’ [-fpermissive]
make: *** [build/intermediate/Debug/juce_opengl_1890bee0.o] Error 1
make: *** Waiting for unfinished jobs....

This fixes the error

diff --git a/modules/juce_opengl/native/juce_OpenGL_linux.h b/modules/juce_opengl/native/juce_OpenGL_linux.h
index c46a569..5e0ada7 100644
--- a/modules/juce_opengl/native/juce_OpenGL_linux.h
+++ b/modules/juce_opengl/native/juce_OpenGL_linux.h
@@ -106,7 +106,7 @@ public:
     void initialiseOnRenderThread()
     {
         ScopedXLock xlock;
-        renderContext = glXCreateContext (display, bestVisual, contextToShareWith, GL_TRUE);
+        renderContext = glXCreateContext (display, bestVisual, (GLXContext) contextToShareWith, GL_TRUE);
         makeActive();
     }

I am using Ubuntu 12.04 64 bit

Peter


#2

Doh! Thanks!