Changeset 8848:b3621123edc6 in orange


Ignore:
Timestamp:
08/30/11 12:39:16 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
14746a6990677bac3c7da04726cc16ce29843919
Message:

Now compiles plot3D.cpp on Mac OSX.

Location:
source/orangeqt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • source/orangeqt/CMakeLists.txt

    r8780 r8848  
    99find_package(SIP REQUIRED) 
    1010find_package(PythonLibrary REQUIRED) 
     11find_package(OpenGL) 
    1112include(SIPMacros) 
    1213 
     
    4243set(SIP_EXTRA_OPTIONS "-k") 
    4344 
    44 set(SIP_EXTRA_LINK_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY}) 
     45set(SIP_EXTRA_LINK_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY}) 
    4546set(SIP_EXTRA_SOURCES ${orangeqt_SRCS}) 
    4647 
  • source/orangeqt/plot3d.cpp

    r8836 r8848  
    33#include <limits> 
    44#include <QGLFormat> 
     5 
     6#ifdef __APPLE__ // OpenGL framework 
     7#include <OpenGL/glext.h> 
     8#else 
    59#include <GL/glx.h> 
    610#include <GL/glxext.h> // TODO: Windows? 
     
    1721PFNGLUNIFORM2FPROC glUniform2f = NULL; 
    1822PFNGLDELETEBUFFERSPROC glDeleteBuffers = NULL; 
     23 
     24#endif //__APPLE__ 
    1925 
    2026#define BUFFER_OFFSET(i) ((char *)NULL + (i)) 
     
    6975    // TODO: wglGetProcAddress 
    7076#else 
     77#ifdef __APPLE__ 
     78// Should check if the extensions are available. 
     79#else 
    7180    glGenBuffers = (PFNGLGENBUFFERSARBPROC)glXGetProcAddress((const GLubyte*)"glGenBuffers"); 
    7281    glBindBuffer = (PFNGLBINDBUFFERPROC)glXGetProcAddress((const GLubyte*)"glBindBuffer"); 
     
    7887    glUniform2f = (PFNGLUNIFORM2FPROC)glXGetProcAddress((const GLubyte*)"glUniform2f"); 
    7988    glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glXGetProcAddress((const GLubyte*)"glDeleteBuffers"); 
    80 #endif 
     89#endif // __APPLE__ 
     90#endif // _WIN32 
    8191} 
    8292 
  • source/orangeqt/plot3d.h

    r8835 r8848  
    77#include <QVector4D> 
    88#include <QMatrix4x4> 
     9 
     10#ifdef __APPLE__ // Apple OpenGL framework (What if we want to use X11 - then the include should be GL/gl.h) 
     11#include <OpenGL/gl.h> 
     12#else 
    913#include <GL/gl.h> 
     14#endif //__APPLE__ 
    1015 
    1116class Plot3D : public QGLWidget { 
Note: See TracChangeset for help on using the changeset viewer.