Browse Source

Remove GLU dependency from Panda3D. Yes. That's right, folks.
And now I shall make myself some coffee and wake up, in that order.

rdb 15 years ago
parent
commit
0ea72a4712

+ 1 - 9
dtool/Config.pp

@@ -596,28 +596,20 @@
 #define ZLIB_LIBS z
 #defer HAVE_ZLIB $[libtest $[ZLIB_LPATH],$[ZLIB_LIBS]]
 
-// Is OpenGL installed, and where?  This should include libGL as well
-// as libGLU, if they are in different places.
+// Is OpenGL installed, and where?
 #defer GL_IPATH /usr/include
 #defer GL_LPATH
 #defer GL_LIBS
-#defer GLU_LIBS
 #if $[WINDOWS_PLATFORM]
   #define GL_LIBS opengl32.lib
-  #define GLU_LIBS glu32.lib
 #elif $[OSX_PLATFORM]
   #defer GL_FRAMEWORK OpenGL
 #else
   #defer GL_LPATH /usr/X11R6/lib
   #defer GL_LIBS GL
-  #defer GLU_LIBS GLU
 #endif
 #defer HAVE_GL $[libtest $[GL_LPATH],$[GL_LIBS]]
 
-// GLU is an auxiliary library that is usually provided with OpenGL,
-// but is sometimes missing (e.g. the default FC5 installation).
-#defer HAVE_GLU $[libtest $[GL_LPATH],$[GLU_LIBS]]
-
 // If you are having trouble linking in OpenGL extension functions at
 // runtime for some reason, you can set this variable.  This defines
 // the minimum runtime version of OpenGL that Panda will require.

+ 10 - 5
dtool/LocalSetup.pp

@@ -123,13 +123,19 @@
 #endif
 #if $[HAVE_GL]
 #print + OpenGL
-#elif $[HAVE_GLES2]
-#print + OpenGL ES 2
-#elif $[HAVE_GLES]
-#print + OpenGL ES
 #else
 #print - Did not find OpenGL
 #endif
+#if $[HAVE_GLES]
+#print + OpenGL ES 1
+#else
+#print - Did not find OpenGL ES 1
+#endif
+#if $[HAVE_GLES2]
+#print + OpenGL ES 2
+#else
+#print - Did not find OpenGL ES 2
+#endif
 #if $[HAVE_DX8]
 #print + DirectX8
 #else
@@ -341,7 +347,6 @@ $[cdefine HAVE_ZLIB]
 
 /* Define if we have OpenGL installed and want to build for GL.  */
 $[cdefine HAVE_GL]
-$[cdefine HAVE_GLU]
 #if HAVE_GL
 # define MIN_GL_VERSION_MAJOR $[word 1,$[MIN_GL_VERSION]]
 # define MIN_GL_VERSION_MINOR $[word 2,$[MIN_GL_VERSION]]

+ 0 - 2
dtool/Package.pp

@@ -221,9 +221,7 @@
 #set GL_IPATH $[unixfilename $[GL_IPATH]]
 #set GL_LPATH $[unixfilename $[GL_LPATH]]
 #set GL_LIBS $[GL_LIBS]
-#set GLU_LIBS $[GLU_LIBS]
 #set HAVE_GL $[HAVE_GL]
-#set HAVE_GLU $[HAVE_GLU]
 
 #set GLES_IPATH $[unixfilename $[GLES_IPATH]]
 #set GLES_LPATH $[unixfilename $[GLES_LPATH]]

+ 1 - 8
dtool/pptempl/Global.pp

@@ -123,7 +123,7 @@
   #define gl_ipath $[wildcard $[GL_IPATH]]
   #define gl_lpath $[wildcard $[GL_LPATH]]
   #define gl_cflags $[GL_CFLAGS]
-  #define gl_libs $[GL_LIBS] $[if $[HAVE_GLU],$[GLU_LIBS]]
+  #define gl_libs $[GL_LIBS]
   #define gl_framework $[GL_FRAMEWORK]
 #endif
 
@@ -199,13 +199,6 @@
   #define egl_libs $[EGL_LIBS]
 #endif
 
-#if $[HAVE_GLUT]
-  #define glut_ipath $[wildcard $[GLUT_IPATH]]
-  #define glut_lpath $[wildcard $[GLUT_LPATH]]
-  #define glut_cflags $[GLUT_CFLAGS]
-  #define glut_libs $[GLUT_LIBS]
-#endif
-
 #if $[HAVE_DX8]
   #define dx8_ipath $[wildcard $[DX8_IPATH]]
   #define dx8_lpath $[wildcard $[DX8_LPATH]]

+ 7 - 8
makepanda/makepanda.py

@@ -406,7 +406,6 @@ if (COMPILER=="MSVC"):
     LibName("WINGDI", "gdi32.lib")
     LibName("ADVAPI", "advapi32.lib")
     LibName("GL", "opengl32.lib")
-    LibName("GL", "glu32.lib")
     LibName("GLES", "libgles_cm.lib")
     LibName("GLES2", "libGLESv2.lib")
     LibName("EGL", "libEGL.lib")
@@ -536,7 +535,7 @@ if (COMPILER=="LINUX"):
         SmartPkgEnable("FFTW",      "",          ("fftw", "rfftw"), ("fftw.h", "rfftw.h"))
         SmartPkgEnable("FMODEX",    "",          ("fmodex"), ("fmodex", "fmodex/fmod.h"))
         SmartPkgEnable("FREETYPE",  "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
-        SmartPkgEnable("GL",        "gl",        ("GL"), ("GL/gl.h", "GL/glu.h"), framework = "OpenGL")
+        SmartPkgEnable("GL",        "gl",        ("GL"), ("GL/gl.h"), framework = "OpenGL")
         SmartPkgEnable("GLES",      "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
         SmartPkgEnable("GLES2",     "glesv2",    ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
         SmartPkgEnable("EGL",       "egl",       ("EGL"), ("EGL/egl.h"))
@@ -3284,9 +3283,9 @@ if (not RUNTIME):
 #
 
 if (not sys.platform.startswith("win") and PkgSkip("GL")==0 and PkgSkip("OSMESA")==0 and not RUNTIME):
-  OPTS=['DIR:panda/src/mesadisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLUT', 'NVIDIACG', 'GL', 'OSMESA']
+  OPTS=['DIR:panda/src/mesadisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAMESA', 'NVIDIACG', 'GL', 'OSMESA']
   TargetAdd('mesadisplay_composite.obj', opts=OPTS, input='mesadisplay_composite.cxx')
-  OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGLUT', 'NVIDIACG', 'GL']
+  OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAMESA', 'NVIDIACG', 'GL']
   TargetAdd('libpandamesa.dll', input='mesadisplay_composite.obj')
   TargetAdd('libpandamesa.dll', input='libp3glstuff.dll')
   TargetAdd('libpandamesa.dll', input='libpandafx.dll')
@@ -3306,9 +3305,9 @@ if (sys.platform != "win32" and sys.platform != "darwin" and PkgSkip("X11")==0 a
 #
 
 if (sys.platform != "win32" and sys.platform != "darwin" and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
-  OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGLUT',  'GL', 'NVIDIACG', 'CGGL']
+  OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL',  'GL', 'NVIDIACG', 'CGGL']
   TargetAdd('glxdisplay_composite.obj', opts=OPTS, input='glxdisplay_composite.cxx')
-  OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGLUT',  'GL', 'NVIDIACG', 'CGGL']
+  OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL',  'GL', 'NVIDIACG', 'CGGL']
   TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
   TargetAdd('libpandagl.dll', input='x11display_composite.obj')
   TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
@@ -3324,10 +3323,10 @@ if (sys.platform != "win32" and sys.platform != "darwin" and PkgSkip("GL")==0 an
 #
 
 if (sys.platform == 'darwin' and PkgSkip("GL")==0 and not RUNTIME):
-  OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGLUT',  'GL', 'NVIDIACG', 'CGGL']
+  OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL',  'GL', 'NVIDIACG', 'CGGL']
   TargetAdd('osxdisplay_composite1.obj', opts=OPTS, input='osxdisplay_composite1.cxx')
   TargetAdd('osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
-  OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGLUT',  'GL', 'NVIDIACG', 'CGGL']
+  OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL',  'GL', 'NVIDIACG', 'CGGL']
   TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
   TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
   TargetAdd('libpandagl.dll', input='glgsg_config_glgsg.obj')

+ 1 - 1
panda/metalibs/pandagl/Sources.pp

@@ -20,5 +20,5 @@
   #define TARGET pandagl
   #define SOURCES pandagl.cxx pandagl.h
   #define INSTALL_HEADERS pandagl.h
-  #define WIN_SYS_LIBS opengl32.lib glu32.lib winmm.lib kernel32.lib oldnames.lib user32.lib gdi32.lib
+  #define WIN_SYS_LIBS opengl32.lib winmm.lib kernel32.lib oldnames.lib user32.lib gdi32.lib
 #end metalib_target

+ 1 - 1
panda/metalibs/pandagl/pandagl.cxx

@@ -1,6 +1,6 @@
 // Filename: pandagl.cxx
 // Created by:  drose (15May00)
-// 
+//
 ////////////////////////////////////////////////////////////////////
 
 #include "pandagl.h"

+ 0 - 1
panda/src/gles2gsg/gles2gsg.h

@@ -22,7 +22,6 @@
 #include "config_gles2gsg.h"
 
 #define GLP(name) gl##name
-#define GLUP(name) glu##name
 #define CLP(name) GLES2##name
 #define GLPREFIX_QUOTED "gl"
 #define CLASSPREFIX_QUOTED "GLES2"

+ 0 - 1
panda/src/glesgsg/glesgsg.h

@@ -22,7 +22,6 @@
 #include "config_glesgsg.h"
 
 #define GLP(name) gl##name
-#define GLUP(name) glu##name
 #define CLP(name) GLES##name
 #define GLPREFIX_QUOTED "gl"
 #define CLASSPREFIX_QUOTED "GLES"

+ 0 - 7
panda/src/glgsg/glgsg.h

@@ -23,7 +23,6 @@
 #include "config_glgsg.h"
 
 #define GLP(name) gl##name
-#define GLUP(name) glu##name
 #define CLP(name) GL##name
 #define GLPREFIX_QUOTED "gl"
 #define CLASSPREFIX_QUOTED "GL"
@@ -70,14 +69,8 @@
 
 #ifdef IS_OSX
   #include <OpenGL/gl.h>
-  #ifdef HAVE_GLU
-  #include <OpenGL/glu.h>
-  #endif
 #else
   #include <GL/gl.h>
-  #ifdef HAVE_GLU
-  #include <GL/glu.h>
-  #endif
 #endif
 
 #undef GL_GLEXT_VERSION

+ 1 - 1
panda/src/glstuff/Sources.pp

@@ -1,6 +1,6 @@
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m prc:c
-#define USE_PACKAGES gl cggl
+
 // Most of the files here are not actually compiled into anything;
 // they're just included by various other directories.
 

+ 6 - 11
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -64,7 +64,7 @@
 #include "graphicsEngine.h"
 #include "shaderGenerator.h"
 
-#ifdef HAVE_CG
+#if defined(HAVE_CG) && !defined(OPENGLES)
 #include "Cg/cgGL.h"
 #endif
 
@@ -838,7 +838,7 @@ reset() {
     }
   }
 
-#ifdef HAVE_CG
+#if defined(HAVE_CG) && !defined(OPENGLES)
   if (cgGLIsProfileSupported(CG_PROFILE_ARBFP1) &&
       cgGLIsProfileSupported(CG_PROFILE_ARBVP1)) {
     _supports_basic_shaders = true;
@@ -1618,7 +1618,7 @@ reset() {
   void gl_set_stencil_functions (StencilRenderStates *stencil_render_states);
   gl_set_stencil_functions (_stencil_render_states);
 
-#ifdef HAVE_CG
+#if defined(HAVE_CG) && !defined(OPENGLES)
 
   typedef struct
   {
@@ -5173,13 +5173,8 @@ report_errors_loop(int line, const char *source_file, GLenum error_code,
 ////////////////////////////////////////////////////////////////////
 string CLP(GraphicsStateGuardian)::
 get_error_string(GLenum error_code) {
-#if defined(HAVE_GLU) && !defined(OPENGLES)
-  const GLubyte *error_string = GLUP(ErrorString)(error_code);
-  if (error_string != (const GLubyte *)NULL) {
-    return string((const char *)error_string);
-  }
-#endif  // HAVE_GLU
-
+  // We used to use gluErrorString here, but I (rdb) took it out
+  // because that was really the only function we used from GLU.
   // The idea with the error table was taken from SGI's sample implementation.
   static const char *error_strings[GL_OUT_OF_MEMORY - GL_INVALID_ENUM + 1] = {
     "invalid enumerant",
@@ -9635,7 +9630,7 @@ do_point_size() {
 ////////////////////////////////////////////////////////////////////
 bool CLP(GraphicsStateGuardian)::
 get_supports_cg_profile(const string &name) const {
-#ifndef HAVE_CG
+#if !defined(HAVE_CG) || defined(OPENGLES)
   return false;
 #else
   CGprofile profile = cgGetProfile(name.c_str());

+ 2 - 3
panda/src/glstuff/glstuff_src.h

@@ -19,15 +19,14 @@
 // file.
 
 // #define GLP(name): returns name prefixed by the gl prefix, e.g. gl##name
-// #define GLUP(name): returns name prefixed by the glu prefix, e.g. glu##name
 // #define CLP(name): returns name prefixed by the class prefix, e.g. GL##name
 // #define CLASSPREFIX_QUOTED: the quoted prefix of CLP, e.g. "GL"
 // #define CONFIGOBJ: a Configrc object, e.g. config_glgsg
 // #define GLCAT: a Notify category, e.g. glgsg_cat
 // #define EXPCL_GL, EXPTP_GL: according to the DLL currently being compiled.
 
-// Also, be sure you include the appropriate gl.h and glu.h header
-// files to get all the standard GL symbols declared.  GL extensions
+// Also, be sure you include the appropriate gl.h header
+// file to get all the standard GL symbols declared.  GL extensions
 // are included here via glext.h.
 
 // This file is not protected from multiple inclusion; it may need to

+ 0 - 3
panda/src/mesadisplay/mesagsg.h

@@ -28,12 +28,10 @@
 
 #ifdef MESA_MGL
   #define GLP(name) mgl##name
-  #define GLUP(name) mglu##name
   #define GLPREFIX_QUOTED "mgl"
   #define USE_MGL_NAMESPACE 1
 #else
   #define GLP(name) gl##name
-  #define GLUP(name) glu##name
   #define GLPREFIX_QUOTED "gl"
 #endif
 #define CLP(name) Mesa##name
@@ -74,7 +72,6 @@
 #define GL_GLEXT_VERSION 0
 
 #include <GL/gl.h>
-#include <GL/glu.h>
 #include <GL/osmesa.h>
 
 #undef GL_GLEXT_VERSION

+ 0 - 1
panda/src/osxdisplay/osxGraphicsBuffer.h

@@ -15,7 +15,6 @@
 
 #define __glext_h_
 #include <OpenGL/gl.h>
-#include <OpenGL/glu.h>
 #include <AGL/agl.h>
 
 #include "pandabase.h"

+ 0 - 1
panda/src/osxdisplay/osxGraphicsStateGuardian.cxx

@@ -19,7 +19,6 @@
 #include "pnmImage.h"
 
 #include <OpenGL/gl.h>
-#include <OpenGL/glu.h>
 #import <mach-o/dyld.h>
 
 // This is generated data for the standard texture we use for drawing

+ 0 - 1
panda/src/osxdisplay/osxGraphicsStateGuardian.h

@@ -16,7 +16,6 @@
 
 #define __glext_h_
 #include <OpenGL/gl.h>
-#include <OpenGL/glu.h>
 #include <AGL/agl.h>
         
 #include "pandabase.h"

+ 0 - 1
panda/src/osxdisplay/osxGraphicsWindow.h

@@ -20,7 +20,6 @@
 
 #define __glext_h_
 #include <OpenGL/gl.h>
-#include <OpenGL/glu.h>
 #include <AGL/agl.h>
 
 #define HACK_SCREEN_HASH_CONTEXT true

+ 0 - 11
panda/src/pandabase/pandasymbols.h

@@ -152,14 +152,6 @@
   #define EXPTP_PANDAGLES2 extern
 #endif
 
-#ifdef BUILDING_PANDAGLUT
-  #define EXPCL_PANDAGLUT __declspec(dllexport)
-  #define EXPTP_PANDAGLUT
-#else
-  #define EXPCL_PANDAGLUT __declspec(dllimport)
-  #define EXPTP_PANDAGLUT extern
-#endif
-
 #ifdef BUILDING_PANDAMESA
   #define EXPCL_PANDAMESA __declspec(dllexport)
   #define EXPTP_PANDAMESA
@@ -298,9 +290,6 @@
 #define EXPCL_PANDAGLES2
 #define EXPTP_PANDAGLES2
 
-#define EXPCL_PANDAGLUT
-#define EXPTP_PANDAGLUT
-
 #define EXPCL_PANDAMESA
 #define EXPTP_PANDAMESA